-1
我需要爲每個座位輸入一個值,並在用戶輸入'q'退出時讓腳本輸出所有座位的總數。這裏是到目前爲止的代碼:我應該如何添加/重做這個python腳本來輸入一個值並打印出所有的?
cost = []
print 'Welcome to the receipt program!'
while True:
cost = raw_input("Enter the value for the seat ['q' to quit]: ")
if cost == 'q':
break
print '*****'
print 'Total: $', cost
這是功課? – tawmas
不,不是......我正在努力學習Python,自己寫一本書。 – user3365803