2. Working with Strings

In this video | 在這條影片中
Basic Use of Strings
  • Strings must be enclosed by quotation marks
  • Strings (str) as a data type
  • Strings can contain both upper and lower case letters
  • A space in a string is treated as a letter
  • 字串必須被引號包圍
  • 資料類型為字串 (str)
  • 字串可使用大小階
  • 字串中的空格被當作字母處理
Joining Strings Together
  • Concatenate (+): joining two strings together
  • Strings can be concatenated with numbers
  • Use str() to convert a number into string for concatenation
  • Concatenate (+): 連接兩組字串
  • 字串可以跟數字連接
  • 使用 str() 把數字轉換成字串,後再連接