前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Python : ex2

Python : ex2

作者头像
项勇
发布2018-12-18 14:13:42
4340
发布2018-12-18 14:13:42
举报
文章被收录于专栏:项勇
代码语言:javascript
复制
print("I will now count my chickens:")
print("Hens",25 + 10 / 2)
print("Roosters",100 - 25 * 2 % 4)
print("Now I will count the eggs:")
print(3 + 2 - 5 % 2 - 1 / 4)
print("Is it true that 3 + 2 >5 -1?")
print(3 + 2 > 5 - 1)
print("What is 3+2? " , 3+2)
print("that is 5-7?",5-7)
print("oh,that's why it's False.")
print("Is it greater?",5>-2)
print("Is it greater or equal?",5>=-2)
print("Is it less or equal?" ,5<=-2)
print("this is float",10.2 * 2.5 + 10.5)
print("what is %?" ,10.0 % 3)
print("what is %?" ,5.0 % 3)
print("what is %?" ,15.0 % 6)
print("% 是余数得意思")

运行结果:

代码语言:javascript
复制
PS C:\Users\even> Python .\lpthw\ex2.py
I will now count my chickens:
Hens 30.0
Roosters 98
Now I will count the eggs:
3.75
Is it true that 3 + 2 >5 -1?
True
What is 3+2?  5
that is 5-7? -2
oh,that's why it's False.
Is it greater? True
Is it greater or equal? True
Is it less or equal? False
this is float 36.0
what is %? 1.0
what is %? 2.0
what is %? 3.0
% 是余数得意思
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2018-11-27,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 项勇 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档