Commit 4e336c63 by BellCodeEditor

auto save

parent 87be3438
Showing with 49 additions and 0 deletions
# n=int(input('请输入体重:'))
# m=float(input('请输入身高:'))
# BMI=n/(m*m)
# if BMI>=28:
# print('肥胖')
# elif 24<=BMI<=27.9:
# print('过重')
# elif 18.5<=BMI<=23.9:
# print('正常')
# else:
# print('偏瘦')
# num=99
# pnum=int(input("玩家输入的数字:"))
# if pnum==num:
# print("sfsf")
# elif pnum>num:
# print('dfs')
# else:
# print('gsgd')
# key='a'
# for key in 'good':
# if key=='d':
# print(key)
# for i in range(1,101,2):
# print(i)
for j in range(1,10):
for i in range(1,j+1):
print(i,'*',j,'=',i*j,end='\t')
print(' ')
\ No newline at end of file
# 这是悟空为花果山小猴做臂力测试的程序代码
name=input('你叫啥名呀?')
power=int(input('你臂力多少啊?'))
list_hero=['猴三',10,'猴一',21,'猴五',22,'猴队长',29,'猴七',30]
for i in range(len(list_hero)):
if i%2==1 and list_hero[i]>=power:
list_hero.insert(i-1,name)
list_hero.insert(i,name)
break
print(list_hero)
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero={'小施':24}
print(dict_hero)
# 直接运行以下代码,说说你的发现:
list_hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98]
dict_hero = {'赵一':30,'丁二':37,'孙五':52,'王猛':89,'周亮':98}
print(len(list_hero))
print(len(dict_hero))
\ 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