Commit ef819b93 by BellCodeEditor

save project

parent 9edf830f
Showing with 30 additions and 25 deletions
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit = int(unit)
except:
print("我告诉你,你要是不输入整数王宣就没了")
else:
total.append(unit)
return total
wx = new_input()
print(wx)
# def new_input():
# total = []
# while True:
# unit= input("请输入:")
# if unit== 'q':
# break
# else:
# try:
# unit = int(unit)
# except:
# print("我告诉你,你要是不输入整数王宣就没了")
# else:
# total.append(unit)
# return total
# wx = new_input()
# print(wx)
def sum(n):
count = 0
for i in n:
count+=1
return count
# def sum(n):
# count = 0
# for i in n:
# count+=1
# return count
wx = new_input()
money = sum(wx)
print("价钱是"+str(money))
\ No newline at end of file
# wx = new_input()
# money = sum(wx)
# print("价钱是"+str(money))
file = open("C:\\Users\\5H\\Desktop\\text.txt","w",encoding='utf-8')
file.write("王宣:自闭")
file.write("你我:快乐")
file.close()
\ 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