Commit ef819b93 by BellCodeEditor

save project

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