Python 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license()” for more information.
5+3 //可直接写数字
8print(5+3)
8print(a+b)//字符需要加双引号
Traceback (most recent call last):
File “<pyshell#2>”, line 1, in
print(a+b)
NameError: name ‘a’ is not definedprint(“a”+“b”)//字符需要加双引号
ab555555*666666//Python不像C语言那样计算量小
370369629630aaaa8
Traceback (most recent call last):
File “<pyshell#5>”, line 1, in
aaaa8 //字符需要加双引号
NameError: name ‘aaaa’ is not defined“aa”*8
‘aaaaaaaaaaaaaaaa’“aa”/n8
Traceback (most recent call last):
File “<pyshell#7>”, line 1, in
“aa”/n8
NameError: name ‘n’ is not defined“aa/n”*3
‘aa/naa/naa/n’“aa\n”*3
‘aa\naa\naa\n’print(“aa\n”*3) //反斜杠要在print里才有用
aa
aa
aa