您的位置:首页 > 编程语言 > Python开发

ex3.py

2016-08-07 16:57 369 查看
ex3.py

print "I will now count my chickens: " # print what I want to do

print "Hens ", 25 + 30 / 6 # print the amount of hens
print "Roosters", 100 - 25 * 3 % 4 # print the amount of roosters

print "Now I will count the eggs:" # print what I will do next

print 3 + 2 + 1 - 5 + 4 % 2 - 1/4 + 6 # print the amount of eggs

print "Is it true that 3 + 2 < 5 - 7?" # caculate something

print 3 + 2 < 5 - 7 # print true or false

print "What 3 + 2?", 3 + 2 # print a result
print "What 5 - 7?", 5 - 7 # print a result

print "Oh, that's why it's False." # print a word

print "How about some more." # print another word

print "Is it greater?", 5 > -2 # print true or false
print "Is it greater or equal?", 5 >= -2 # print true or false
print "Is it less or equal?", 5 <= -2 # print true or false


python中的数学运算
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python