7-45 jmu-python-涨工资 (10 分),,输入一组工资数据,写
7-45 jmu-python-涨工资 (10 分),,输入一组工资数据,写
输入一组工资数据,写入列表。对于小于5000的工资,涨1.5倍。并输出涨后的工资数据。
输入格式:
数据之间空格隔开
输出格式:
涨工资后的数据,空格隔开。尾部 不带空格。
输入样例:
3000 4000 6000 8000 2000.5
输出样例:
4500.0 6000.0 6000 8000 3000.75
s = input()ls = []ls = s.split()cnt = 0for i in ls: i = float(i) if i <= 5000 and cnt == 1: if i - int(i) > 0: print(" {:.2f}".format(i * 1.5), end="") else : print(" {:.1f}".format(i*1.5),end="") elif i > 5000 and cnt == 1: print(" {:d}".format(int(i)),end="") if cnt == 0: if i <= 5000: if i - int(i) > 0: print("{:.2f}".format(i * 1.5), end="") cnt = 1 else: print("{:.1f}".format(i * 1.5), end="") cnt = 1 else: print("{:d}".format(int(i)), end="") cnt = 1
7-45 jmu-python-涨工资 (10 分)
相关内容
- 利用kibana插件对Elasticsearch进行bool查询,,#bool查询#老版
- 窦小凤2020寒假学习心得,,2020年1-2月寒
- Flask-Migrate的作用以及安装,,1.因为采用db.c
- numpy里*与dot与multiply,,一、* dot()
- Python 树/搜索类算法,,BFS:#1.设置队
- python3.7安装charts库(Win10系统),,本人是Anacond
- Python - 命令式编程与符号编程,,原文链接:https
- Python字符串习题,,请用代码实现: a.
- 初级python编程入门看过来(Python就业工资有多少),
- Python callable() 函数,,Python cal
评论关闭