找回密码
 中文实名注册
查看: 119|回复: 2

Python作业 樊泽宇 413

[复制链接]

13

主题

60

帖子

493

积分

中级会员

Rank: 3Rank: 3

积分
493
发表于 2023-11-18 12:06:42 | 显示全部楼层 |阅读模式
Python作业 樊泽宇 413
回复

使用道具 举报

13

主题

60

帖子

493

积分

中级会员

Rank: 3Rank: 3

积分
493
 楼主| 发表于 2023-11-18 12:07:14 | 显示全部楼层
[Python] 纯文本查看 复制代码
height=input("请输入身高")
weight = input("请输入体重")
height = float(height)
weight = float(weight)
bmi = weight/(height*height)
if bmi<18.5:
    print("偏瘦,增加体重")
elif bmi <=24:
    print("正常,保持")
else :
    print("超重,控制")  
回复

使用道具 举报

13

主题

60

帖子

493

积分

中级会员

Rank: 3Rank: 3

积分
493
 楼主| 发表于 2023-11-25 11:34:21 | 显示全部楼层
import api
name=api.get_dish_name("菜品1.pog")
caiorie=api.get_dish_caiories("菜品1.pog")
sb1="这道菜是"+name
print(sb1)
sb2="一百颗含有"+str(caiorie)+"大卡"
print(sb2)

if caiorie>140:
    print("高热量")
elif caiorie>70:
    print("中热量")
else:
    print("低热量")




















































































回复

使用道具 举报

您需要登录后才可以回帖 登录 | 中文实名注册

本版积分规则

小黑屋|东台市机器人学会 ( 苏ICP备2021035350号-1;苏ICP备2021035350号-2;苏ICP备2021035350号-3 )

GMT+8, 2024-5-3 07:12 , Processed in 0.046909 second(s), 28 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表