-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex3.py
More file actions
26 lines (20 loc) · 756 Bytes
/
ex3.py
File metadata and controls
26 lines (20 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Numbers and Math
print("I will now count my chickens")
# 30/6 = 5, 25 + 5 = 30 hens
print("Hens", 25 + 30 / 6)
# -25 times 3 = -75; modulus of -75 % 4 = 3; 100 - 3 = 97 roosters
print("Roosters", 100 - 25 * 3 % 4)
print("Now I will count the eggs:")
# -1 / 4 = -.25; -.25 + 6 = 5.75; 4 % 2 = 0; 5.75 + 0 = 5.75;
# Add 3, 2, 1 and subtract 5 = 1; 1 + 5.75 = 6.75 eggs
print(3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6)
print("Is it true that 3 + 2 < 5 - 7?")
# 5 < -2 = False
print(3 + 2 < 5 - 7)
print("What is 3 + 2?", 3 + 2)
print("What is 5 - 7?", 5 - 7)
print("Oh, that's why it's False.")
print("How about some more.")
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