Microsoft Windows [版本 10.0.19044.2846](c) Microsoft Corporation。保留所有权利。
C:\Users\M1921>Python
Python 3.8.0(tags/v3.8.0:fa919fd, Oct 142019,19:37:50)[MSC v.191664 bit (AMD64)] on win32
Type "help","copyright","credits"or"license"for more information.>>> n =123>>>print('n','=',n)
n =123>>> f =456.789>>>print('f =',f)
f =456.789>>> s1 ='Hello,world'>>>print('s1 =',s1)
s1 = Hello,world
>>> s2 ='Hello,\'Adam\''//如果字符串内部既包含'又包含"怎么办?可以用转义字符\来标识
>>>print('s2 =',s2)
s2 = Hello,'Adam'>>> s3 =r'Hello,"Bart"'//Python还允许用r''表示''内部的字符串默认不转义
>>>print('s3 =',s3)
s3 = Hello,"Bart">>> s4 =r'''Hello,
... Lisa!'''//如果字符串内部有很多换行,用\n写在一行里不好阅读,为了简化,Python允许用'''...'''的格式表示多行内容
>>>print('s4 =',s4)
s4 = Hello,
Lisa!