python-hard-way/2/ex3.py

24 lines
689 B
Python
Raw Permalink Normal View History

2018-08-31 23:47:16 +00:00
print "I will now count my chickens:" # Prints text
print "Hens", 25.0 + 30.0 / 6.0 # Divides, then adds the numbers together.
print "Roosters", 100.0 - 25.0 * 3.0 % 4.0 # Multiplies 25 and 3, then runs 75 mod 4 which is 3, then subtracts that from 10.00.0.
print "Now I will count the eggs:" # More text.
print 3.0 + 2.0 + 1.0 - 5.0 + 4.0 % 2.0 - 1.0 / 4.0 + 6.0 #
print "Is it true that 3 + 2 < 5 - 7"
print 3.0 + 2.0 < 5.0 - 7.0
print "What is 3 +2?", 3.0 + 2.0
print "What is 5 -7?", 5.0 - 7.0
print "That's why it's False."
print "How about some more?"
print "Is it greater?", 5.0 > -2.0
print "Is it greater or equal?", 5.0 >= -2.0
print "Is it less or equal?", 5.0 <= -2.0