Python 入門指南 V2.00 - 單元 5 範例及練習程式碼



exercise0501.py


a = 2
b = 8
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a % b)
 
# 檔名: exercise0501.py 
# 作者: Kaiching Chang 
# 時間: July, 2014

exercise0502.py


a = int(input("Please input the first number: "))
b = int(input("Please input the second number: "))
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a % b)
 
# 檔名: exercise0502.py 
# 作者: Kaiching Chang 
# 時間: July, 2014

exercise0502.py


a = "*"
print(a)
print(a + a)
print(a + a + a)
print(a + a + a + a)
print(a + a + a + a + a)
 
# 檔名: exercise0502.py 
# 作者: Kaiching Chang 
# 時間: July, 2014

the end

沒有留言: