Commit 0bba5f76 by BellCodeEditor

auto save

parent 024fb164
Showing with 36 additions and 9 deletions
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
total.append(unit)
print(total)
\ No newline at end of file
# total = [] #新建一个空列表
# while True: #重复执行
# unit= input("请输入:") #将用户输入的内容赋值给变量unit
# if unit== 'q': #如果unit的值为"q"
# break #跳出循环
# else: #否则
# try:
# unit=int()
# total.append(unit) #将unit的值加入到total列表的末尾
# print(total) #打印出total列表的所有值
a = "python"
num = int(input("请输入需要的打印的次数:"))
for i in range(num):
print(a)
\ 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