Commit 98d03e09 by BellCodeEditor

save project

parent dfe18f9d
Showing with 45 additions and 30 deletions
#def new_input():
# total = []
# while True:
# unit= input('请输入单价 (q键退出):')
# if unit=='q':
# break
# else:
# try:
# unit = int(unit)
# except:
# print('请重新输入一个数字')
# else:
# total.append(unit)
# finally:
# print('-'*30)
# return total
# print(total)
#new_input()
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#price=[15,18,14,25]
#count=0
#for i in price:
# count=count+i
#prnit(count)
def hello(name):
content="你好!"+name
return content
def abc():
total = []
while True:
unit= input('请输入单价 (q键退出):')
if unit=='q':
break
else:
try:
unit = int(unit)
except:
print('请重新输入一个数字')
else:
total.append(unit)
finally:
print('-'*30)
print(total)
return total
def mk(money):
count=0
for i in money:
count+=i
return count
#price=abc()
#pay=sum(price)
#print("y"+str(pay)+"元")
result=hello("小依")
print(result)
\ No newline at end of file
import func
price=abc()
pay=sum(price)
def mk(money):
count=0
for i in money:
count+=i
return count
print(str(pay)+"分")
\ No newline at end of file
import func
price=abc()
pay=sum(price)
def mk(money):
count=0
for i in money:
count+=i
return count
print(str(pay)+"分")
\ 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