小弟学了五年程式语言
妈妈的逻辑应该是这样
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颗苹果?!”
: 我回答:“因为他们有鸡蛋啊!!!!”