1+1
2
測試
myString = 'hello world!'
myString
'hello world!'
print (myString)
hello world!
print ('\\\n\\')
\
\
print ('\\\t\\')
\ \
print (r'\\\t\\')
\\\t\\
print ('I\'m OK!')
I'm OK!
print ('I\'m learning\nPython')
I'm learning
Python
print ('''line1
... line2
... line3''')
line1
line2
line3
print ('''line1
line2
line3''')
line1
line2
line3
print (r'''line1
... line2
... line3''')
line1
line2
line3
True
True
False
False
3>2
True
3<2
False
python 可以直接輸出多個字符串,以","隔開
print ('The quick brown fox','jumps over','the lazy dog')
The quick brown fox jumps over the lazy dog
print ('300')
300
print (100 + 200)
300
print ('100 + 200 =',100 + 200)
100 + 200 = 300
name = input()
LiLi
name
'LiLi'
name = input('please enter your name')
print ('hello',name)
please enter your namelyly
hello lyly
-
執(zhí)行簡單腳本
image.png

image.png
