1. 程式人生 > >learn python the hard way 習題1~5總結

learn python the hard way 習題1~5總結

習題1

print 語句
print('Yay! Printing.')
print('I "said" do not touch this')

習題2:註釋和 # 號

#(octothorpe),用於註釋一條語句,在 # 之後的內容全部被忽略。

習題3:數字和數字計算

當進行關係運算的時候,比如 3+2<5-7,那麼返回的是一個 True 或者 False

習題4:變數和命名

設定變數之後,可以在以後的時候用到。

習題5:更多的變數和列印

print(f"{}")
f告訴python 後面的{}是一段格式化的輸出,{}中可包含數字和字串