Commit 960b2fa3 by BellCodeEditor

save project

parent 68ef6810
Showing with 35 additions and 19 deletions
list=["苹果","香蕉","土豆","山竹","葡萄"]
a=list[2]
print(a)
list[1]="鸭梨"
print(list)
list.pop(3)
print(list)
list.insert(3,"榴莲")
print(list)
i=0
while i<len(list):
if list[i]=="葡萄":
print(i)
i=i+1
\ No newline at end of file
# a=["肖","40","于","100","张","0"]
# b={"肖":40,"于":100,"张":0}
# print(len(b))
# print(len(a))
#
# e={"于":23,"于":27,"于":80}
# print(e)
dict={"猴三":10,"猴一":21,"猴五":22,"猴队长":29,"猴七":30}
print(dict["猴队长"])
print(dict["猴一"])
dict["猴七"]=35
print(dict)
dict["猴三十二"]=100
print(dict)
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
mony=int(money)
except:
print("请重新输入")
else:
total.append(unit)
finally:
print("-"*30)
return total
r=new_input()
print(r)
\ 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