ungleich-learning-circle/youngjin.han/python-the-hard-way/ex3.py

24 lines
720 B
Python
Raw Normal View History

2020-05-18 15:00:27 +00:00
print("I will now count my chickens:")
2020-05-18 14:32:23 +00:00
print("Hens", 25 + 30 / 6) # 25 + (30 / 6) = 25 + 5 = 30
print("Roosters", 100 - 25 * 3 % 4) # 100 - (25 * 3 % 4) = 100 - (75 % 4) = 100 - 3 = 97
print("Now I will count the eggs:") # print syntex
print(3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6) # 3 + 2 + 1 - 5 + 0 - 0.25 + 6 = 6.75
print("Is it true that 3 + 2 < 5 - 7?") # print syntex
print(3 + 2 < 5 - 7) # 5 < -2 => false
print("What is 3 + 2?", 3 + 2) # 5
print("What is 5 - 7?", 5 - 7) # -2
print("Oh, that's why it's False.") # print syntex
print("How about some more.") # print syntex
print("Is it greater?", 5 > -2) # true
print("Is it greater or equal?", 5 >= -2) # true
print("Is it less or equal?", 5 <= -2) # false