- 博客(10)
- 资源 (1)
- 收藏
- 关注
原创 愚人节奇遇记
import timeprint("What is your name?")name = input(":")print("%s, Do you want power? " % name)time.sleep(10)print("")print("Tell me your choice")time.sleep(4)print(" ")print("YES or NO")while True: reply = input(":") if reply == "YES": .
2021-12-02 21:01:46
233
原创 苹果与虫子
# 你买了一箱n个苹果,很不幸的是买完时箱子里混进了一条虫子。虫子每x小时能吃掉一个苹果,假设虫子在吃完一个苹果之前不会吃另一个,那么经过y小时你还有多少个完整的苹果?n, x, y = map(eval, input().split())a = n-(y/x)if a >= 0: print(int(a))else: print(0)...
2021-11-25 15:20:58
462
原创 虫子与苹果
# 你买了一箱n个苹果,很不幸的是买完时箱子里混进了一条虫子。虫子每x小时能吃掉一个苹果,假设虫子在吃完一个苹果之前不会吃另一个,那么经过y小时你还有多少个完整的苹果?n, x, y = map(eval, input().split())a = n-(y/x)print(int(a))...
2021-11-21 20:59:33
492
原创 按套餐计算话费
题目忘了,再t = int(input("请输入一个月的通话时间:"))a = input("是否是固定套餐用户(y:固定用户,n:非固定用户):")while True: if a.lower() in ("y",): if t <= 300: s = 50 else: s = 0.1*(t-300)+50 print("您一个月的话费为", s) else:
2021-11-20 13:16:47
1463
2
原创 输入三个整数,按大小顺序打印
a, b, c = map(eval, input("请输入三个整数:").split())if a > b: a, b = b, aif a > c: a, c = c, aif b > c: b, c = c, bprint("将这三个整数从小到大排列为:", a, b, c)注释十分重要,教训惨痛
2021-11-20 13:04:43
533
原创 计算npv
学习工程经济后的突发奇想t = int(input('请输入第__年:'))CI1 = int(input('该年收益:'))CO1 = int(input("该年支出:"))i = eval(input('基准收益率:'))a = 1 + ib = a ** tNPV1 = (CI1 - CO1) / bprint(NPV1)t = int(input('请输入第__年:'))CI1 = int(input('该年收益:'))CO1 = int(input("该年支出:"))a
2021-11-20 12:58:18
563
原创 无聊小玩意
import timeprint('来用年龄测试你的属性吧!')youage = int(input('请输入你的年龄:'))print("正在分析中........")if 0 < youage < 18: print('幼稚')elif 18 <= youage < 30: print('废物')elif 30 <= youage < 100: print('老东西')else: print('你人没了')print(.
2021-11-20 12:37:26
515
原创 输入PM2.5的值,判断空气质量
输入PM2.5的值,判断空气质量a = int(input('请输入PM2.5的值:'))if 0 < a <= 35: print('优')elif 35 < a <= 75: print('良')elif 75 < a <= 115: print('轻度污染')elif 115 < a <= 150: print('中度污染')elif 150 < a <= 250: print('重度污
2021-11-20 11:57:12
9949
1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人