python版本:3 若有錯誤,
敬請指出 模組名稱:測試.py
執行截圖:#加分習題30
people = 30
cars = 40
buses = 15
if cars > people:
print("we should take the cars.")
elif cars < people:
print("we should not take the cars.")
else:
print("we can't decide.")
if buses > cars:
print("that's too many buses")
elif buses < cars:
print("maybe we could take the buses.")
else:
print("we still can't decide.")
if people > buses:
print("alright,let's just take the buses.")
else:
print("fine,let's stay home then.")
#1#如果if為false,則執行elif,若是elif為true,執行elif下面的**塊
#若是elif為false,則執行else下面的**塊
#2略#3
if cars > people and buses < cars:
print("true")
if cars > people and buses <= cars:
print("true")
if cars > people and buses == cars:
print("true")
else:
print("false")
#4略
笨辦法學python加分習題36
python版本 3 若有錯誤,敬請指出 模組名稱 測試.py 我可能是個傻姑娘.加分習題36 def a print 吃西紅柿炒蛋時,你常常煩惱是該先吃西紅柿還是先雞蛋嗎?print a 是 nb 否 answer input if answer.upper a b elif answer.upp...
笨辦法學python加分習題38
python版本 3 若有錯誤,敬請指出 模組名稱 測試.py 加分習題38 states cities cities ny new york cities or portland print 10,1 print ny stae has cities ny print or state has c...
笨辦法學Python習題35 加分習題
加分習題 1.把這個遊戲的地圖畫出來,把自己的路線也畫出來。2.改正你所有的錯誤,包括拼寫錯誤。3.為你不懂的函式寫註解。記得文件註解該怎麼寫嗎?4.為遊戲新增更多元素。通過怎樣的方式可以簡化並且擴充套件遊戲的功能呢?5.這個 gold room 遊戲使用了奇怪的方式讓你鍵入乙個數字。這種方式會導致...