Commit af68555b by BellCodeEditor

save project

parent 3b393db7
Showing with 11 additions and 9 deletions
total = [] def new_input():#定义一个新函数
while True: total = []#创建一个变量存放价格
unit= input("请输入:") while True:#无限循环
if unit== 'q': unit= input('请输入(q退出):')#输入的内容赋值给unit这个变量
break if unit== 'q':#如果输入的内容失q的话
else: break#终止程序
total.append(unit) else:#否则
print(total) total.append(unit)#将输入的价格追加到total价格列表中
\ No newline at end of file print(total)#打印价格的列表
new_input()#调用函数
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment