其他分享
首页 > 其他分享> > 13 刘欣晨

13 刘欣晨

作者:互联网

实验 一  项目名称:根据身高、体重计算BMI指数

实验内容:

height = 1.70

print("您的身高:" + str(height))

weight = 48.5

print("您的体重:" + str(weight))

bmi=weight/(height+height)

print("您的BMI指数为:"+str(bmi))

#判断身材是否合理

if bmi<18.5:

    print("您的体重过轻 ~@_@~")

if bmi>=18.5 and bmi<24.9:

    print("正常范围,注意保持 (-_-)")

if bmi>=24.9 and bmi<29.9:

    print("您的体重过重 ~@_@~")

if bmi>=29.9:

print("肥胖 ^@_@^")

 

 

实验 二  项目名称:输出007号坦克

实验内容:

print('''

                        ▶   学编程,你不是一个人在战斗是~~

                         |

                __\--__|_

II=======OOOOO[/ ★007___|

          _____\______\/-----.

        /___mingrisoft.com___|

        \◎◎◎◎◎◎◎◎⊙/

       ~~~~~~~~~~~~

''')

 

 

实验 三  项目名称:模拟超市抹零结账行为

实验内容:

money_all=56.75+72.91+88.50+26.37+68.51

money_all_str=str(money_all)

print("商品总金额为:"+money_all_str)

money_real=int(money_all)

money_real_str=str(money_real)

print("实验金额为:"+money_real_str)

 

 

实验 四  项目名称:计算分数差以及平均分

实验内容:

python =95

english=92

c=89

sub=python-c

avg=(python+english+c)/3

print("Python课程和C语言课程的分数之差:"+str(sub)+"分\n")

print("3门课的平均分:"+str(avg)+"分")

 

 

实验 五  项目名称:使用比较运算符比较大小

实验内容:

python=95

english=92

c=89

print("python="+str(python)  +  " english="+str(english)  +  " c="+str(c)+"\n")

print("python<english的结果:"+str(python<english))

print("python>english的结果:"+str(python>english))

print("python==english的结果:"+str(python==english))

print("python!=english的结果:"+str(python!=english))

print("python<=english的结果:"+str(python<=english))

print("python>=c的结果:"+str(python>=c))

 

 

实验 六  项目名称:参加手机店打折活动

实验内容:

print("\n手机店正在打折,活动进行中....")

strWeek=input("请输入中文星期(如星期一):")

intTime=int(input("请输入时间中的小时(范围:0~23):"))

if(strWeek=="星期二"and(intTime >= 10 and intTime <=11))or(strWeek =="星期五" and (intTime >=14 and intTime <=15)):

    print("恭喜您,获得了折扣活动参与资格,快快选购吧!")

else:

print("对不起,您来晚一步,期待下次活动...")

 

 

实验 七  项目名称:根据身高、体重计算BMI指数(改进版)

实验内容:

height = float(input("请输入您的身高(单位为米):"))

weight = float(input("请输入您的体重(单位为千克):"))

bmi=weight/(height*height)

print("的BMI指数为:"+str(bmi))

if bmi<18.5:

    print("您的体重过轻~@_@~")

if bmi>=18.5 and bmi<24.9:

    print("正常范围,注意保持(-_-)")

if bmi>=24.9 and bmi<29.9:

    print("您的体重过重~@_@~")

if bmi>=29.9:

print("肥胖^@_@^")

 

标签:13,python,money,刘欣晨,bmi,str,english,print
来源: https://www.cnblogs.com/L13538196467/p/16694183.html