china2022 发表于 2022-10-22 21:58:08

新一天打卡

1. 字符串的分类 Single quotes    Double quotesTriple quoted
      2. 单引号和双引号一定要确保语句中是成双成对的
      3. >>>print('let's go!')   错误写法   'let'当成变量了
      4. >>>print("let's go!")正确写法
      5. 引用名句的写法"人生苦短,我用Python"
      6. >>>print('"Life is short,you need Python"')
      7. >>>"Life is short,you need Python"
      8. 转义字符\
      9. >>>print('"Life is short,let's learn Python"')
            
      >>>SyntaxError: unterminated string literal (detected at line 1)
      >>>print('\"Life is short,let\'s learn Python"\')
            
      >>>SyntaxError: unterminated string literal (detected at line 1)
      >>>print('\"Life is short,let\'s learn Python\"')
            
      >>>"Life is short,let's learn Python"
      >>>print("\"Life is short,let\'s learn Python\"")
            
      >>>"Life is short,let's learn Python"
      10.换行符\n
      print("I love Python,\nI love Python.")
            
      I love Python,
      I love Python.
页: [1]
查看完整版本: 新一天打卡