找回密码
 中文实名注册
查看: 190|回复: 0

3单元 6课 星际跳高

[复制链接]

8

主题

26

帖子

691

积分

高级会员

Rank: 4

积分
691
发表于 2022-8-21 17:34:03 | 显示全部楼层 |阅读模式

[Python] 纯文本查看 复制代码
def jump(height,planet):
    if planet == '月球':
        result = height*6
    if planet == '火星':
        result = height*2.5
    if planet == '木星':
        result = height*0.4
    if planet == '坤坤星':
        result = height*3.14
    sentence = '你可以在'+planet+'跳'+str(result)+'米'
    print(sentence)

jump(1, '坤坤星')
jump(1, '木星')
jump(1, '火星')
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-9 19:20 , Processed in 0.041796 second(s), 28 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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