小弟學了五年程式語言
媽媽的邏輯應該是這樣
import time
#What does the supermarket sell
market = ["apples", "eggs", "cokes", "jokes", "pianos", "dreams"]
#My shopping cart
shoppingcart = []
#Shopping
try:
if market.index("eggs") > -1:
shoppingcart += ["apple"] * 6
except:
shoppingcart += ["apple"]
#Cheat those who dont understand
total = 0
while total <= 30:
total += 1
time.sleep(0.1)
#Result
print("Hello word!", shoppingcart)
※ 引述《bossun851020 (Bossun)》之銘言:
: 媽媽:「親愛的,幫忙去超市買1顆蘋果回來。 如果他們有雞蛋的話,買6顆。」
: 最後我買了6顆蘋果回家。
: 她問:「你為什麼要買6顆蘋果?!」
: 我回答:「因為他們有雞蛋啊!!!!」