Commit 73855c2f by BellCodeEditor

save project

parent eb7f99d9
Showing with 21 additions and 13 deletions
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典 alist = [20,17,9,13,8,6]
dict_hero={'猴三':10,,'猴一':21,'猴五':22,'猴队长':29,'猴七':30}
print(dict_hero)
dict_hero['猴七']=32 for i in range(0,5):
print(dict_hero) for j in range(0,5):
dict_hero['猴十']=25
print(dict_hero) if alist[j]>alist[j+1]:
\ No newline at end of file alist[j], alist[j+1] = alist[j+1],alist[j]
print(alist)
\ No newline at end of file
# 直接运行以下代码,说说你的发现: import time
list_hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98]
dict_hero = {'赵一':30,'丁二':37,'孙五':52,'王猛':89,'周亮':98} star_time = time.time()
print(len(list_hero)) print("开始时间为:"star_time)
print(len(dict_hero)) for a in riange(0,1001):
for b in riange(0,1001):
for c in riange(0,1001):
if a**2+b**2==c**2 and a+b+c==1000:
print("a,b,c的值分别为:",a,b,c)
end_time = time.time()
print("结束时间为:",end_time)
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