猫史档案馆


【Python作品分享】长沙地铁【作品秀】

用户:Mzd大帅哥Mzd大帅哥查看:0 回复:0 评论:0 创建时间:2023-11-11T23:57:32


【作品展示】

center_image

 

【作品介绍】

长沙地铁

作者:莫政东

 

【作品源代码】

n = int(input("欢迎乘坐长沙地铁,请问乘坐几站?"))
if n >= 0 and n <= 5:
    print(1/2*n, "0元,请支付。")
if n > 5 and n <= 10:
    print(5//4*n-2, ".00元,请支付。")
if n > 10 and n <= 15:
    print(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下一页