首页
友情链接
每日60s读懂世界
Search
1
伊朗.ir后缀域名免费注册
225 阅读
2
Python模拟实现“京东秒杀”界面文字内容
183 阅读
3
用C语言程序将十进制数转换为二进制数
173 阅读
4
Python的NumPy库
157 阅读
5
英语词汇105-121
141 阅读
英语的平行世界
HTML5+CSS3
Python
C语言
MySQL
技术分享
登录
Search
标签搜索
英语的平行世界
正文
词汇
Python程序设计任务驱动式教程
Python数据分析案例实战
Numpy库
C语言程序设计实例教程慕课版|第二版
中华人民共和国网络安全法
.ir域名
域名注册
免费域名
M.
累计撰写
21
篇文章
累计收到
88
条评论
首页
栏目
英语的平行世界
HTML5+CSS3
Python
C语言
MySQL
技术分享
页面
友情链接
每日60s读懂世界
搜索到
21
篇与
的结果
2023-10-25
用Python计算与输入购买商品的实付总额等数据
说明num 赋值为商品数量 input输出number 定义为整数, int指的是整数originalprice、discountprice 赋值为99.80和91.80,后面代码将其定义为(商品原价-商品现价)和商品原价discountRate 定义为(商品原价-商品现价)/商品原价total 定义为所购买的商品总价cashback 定义为返现金额discount 定义为商品优惠金额totalDiscount 定义为返现金额加上优惠金额carriage 赋值为15,定义为运费payable定义为实付总额chr(9785) 是一个笑脸表情{:.2f}.format 表示输出的函数保留两位小数任务2-3{tabs}{tabs-pane label="任务代码"}num=input("请输入购买数量:") number=int(num) originalPrice=99.80 discountPrice=91.80 discountRate=discountPrice/originalPrice total=number*discountPrice cashback=150.00 discount=15.00 totalDiscount=cashback+discount carriage=15.00 payable=total-totalDiscount+carriage print(str(number)+"件商品,总商品金额: ¥"+"{:.2f}".format(total)) print(" 运费: "+chr(9785)+"¥"+"{:.2f}".format(carriage)) print(" 返现: -¥"+"{:.2f}".format(cashback)) print(" 折扣率: -¥"+"{:.2f}%".format(discountRate*100)) print(" 商品优惠: -¥"+"{:.2f}".format(discount)) print(" 实付总额: ¥"+"{:.2f}".format(payable)){/tabs-pane}{tabs-pane label="运行成功效果"}{/tabs-pane}{/tabs}format函数用法格式描述<左对齐>右对齐^居中对齐{:b}将数字用二进制表示{:c}将整数转换成对应的Unicode字符串{:d}将数字用十进制整数表示(format中相应内容应是整数{:o}将数字用八进制表示{:x}将数字用十六进制表示{:#x}针对字母小写,补充前缀其他进制可以用{:#X}针对字母大写,补充前缀只有十六进制使用{:f}将数字用浮点数表示{:e}将数字用科学计数法表示{:%}将数字用百分数表示{:,}用逗号分隔数字{:.2%}将数字用百分数表示,且小数点保留两位小数{:.2f}保留两位小数{:.3f}保留三位小数{:+.2f}带符号保留小数点后两位{:.0f}不带小数{:0<2d}数字补零(填充左边,宽度为2){:x<4d}数字补x(填充右边,宽度为4){:.2%}百分比格式{:.2e}指数记法{:>10d}右对齐(宽度为10){:<10d}左对齐(宽度为10){:^10d}居中对齐(宽度为10)
2023年10月25日
103 阅读
0 评论
0 点赞
2023-10-25
英语词汇105-121
{mtitle title="Lesson17:How do you do?"/}Listen to the tape then answer this question.What are Michael Baker and Jeremy short's Jobs?Come and meet our employees, Mr.Richards.Thank you,Mr.Jackson.This is Nicola Grey,and this is Claire Taylor.How do you do?Those women are very hard-working.What are their jobs?They're keyboard operations.This is Michael Baker,and this is Jeremy Short.How do you do?They aren't very busy!What are their jobs?They're sales reps.They're very lazy.Who is this young man?This is Jim.He's our office assistant.do employees Those women hard-working their busy sales reps lazy who young man office assistant {progress percentage="1%" color="#ff6c6c"/}
2023年10月25日
141 阅读
7 评论
1 点赞
2023-10-25
英语词汇93-104
{mtitle title="Lesson15:Your passports,please."/}Listen to the tape then answer this question.Is there a problem with the customs officer?Are you Swedish?No,we are not.We are Danish.Are your friends Danish,too?No,they aren't.They are Norwegian.Your passports,please.Here they are.Are these your cases?No,they aren't.Our cases are brown.Here they are.Are you tourists?Yes,we are.Are your friends tourists too?Yes,they are.That's fine.Thank you very much.passports Swedish we Danish friends they Norwegian these cases our brown tourists {progress percentage="1%" color="#ff6c6c"/}
2023年10月25日
116 阅读
0 评论
0 点赞
2023-10-25
英语词汇83-92
{mtitle title="Lesson13:A new dress"/}Listen to the tape then answer this question.What color is Anna's hat?What color's your new dress?It's green.Come upstairs and see it.Thank you.Look!Here is it!That's a nice dress.It's very smart.My hat's new,too.What color is it?It's green,too.That is a lovely hat!dress color green come upstairs look smart hat lovely {progress percentage="1%" color="#ff6c6c"/}
2023年10月25日
121 阅读
0 评论
0 点赞
2023-10-25
英语词汇75-82
{mtitle title="Lesson11:Is this your shirt?"/}Listen to the tape then answer this question.Whose shirt is white?Whose shirt is that?Is this your shirt,Dare?No,sir.It's not my shirt.This is my shirt.My shirt's blue.Is this shirt Tim's?Perhaps it is,sir.Tim's shirt's white.Tim!Yes,sir?Is this your shirt?Yes,sir.Here you are. Catch!Thank you,sir.shirt that blue perhaps white Here you are Catch {progress percentage="1%" color="#ff6c6c"/}
2023年10月25日
84 阅读
0 评论
0 点赞
1
2
3
...
5