猫史档案馆


【Python作品分享】M政东【作业帖】

用户:Mzd大帅哥Mzd大帅哥查看:0 回复:0 评论:0 创建时间:2024-04-27T17:41:12


【作品展示】

center_image

 

【作品介绍】

nice

 

【作品源代码】

import math


print('欢迎乘坐长沙地铁。')
x = int(input('请问乘坐几号线?'))
if (x <= 6 and x > 0):
    print('好的。')
else:
    print('滚')
n = int(input('请问乘坐几站?'))
if (n >= 0 and n <= 5):
    print(((1 / 2) * n), '0元,请支付。')
if (n > 5 and n <= 10):
    print((math.floor(5 / 4) * n - 2), '.00元,请支付。')
if (n > 10 and n <= 15):
    print((math.floor(4 / 3) * ((6 + 2 * (n - 10)) + 1)), '.00元,请支付。')
if (n > 15 and n <= 100 or n <= 0):
    print('滚')
if (n > 100):
    print('Are you crazy?')

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页