-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex03.py
More file actions
40 lines (36 loc) · 1.33 KB
/
Copy pathex03.py
File metadata and controls
40 lines (36 loc) · 1.33 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# + plus does addition
# - minus does subtraction
# / slash does division
# * asterisk does multiplication
# % percent
# < less-than
# > greater-than
# <= less-than-equal
# >= greater-than-equal
print "I will now count my chickens:"
# This line prints Hens and the sum of 25 plus (30/6)
print "Hens", 25.0 + 30 / 6
# This line prints Roosters and the sum of the equation
print "Roosters", 10 - 25 * 3 % 4
# This line prints the string in quotes
print "Now I will count the eggs:"
# This line prints the sum of the equation
print 3.0 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6
# this line prints the string in quotes
print "Is it true that 3 + 2 < 5 - 7?"
# This line prints the sum of the equation
print 3 + 2 < 5 - 7
# This line prints the string in quotes and the sum of the equation
print "What is 3 + 2?", 3+2
# This line prints the string in quotes and the sum of the equation
print "What is 5 - 7?", 5 - 7
# This line prints the string in quotes
print "Oh, that's why it's False."
# This line prints the string in quotes
print "How about some more."
# This line prints the string in quotes and the value of the boolean
print "Is it greater?", 5 > -2
# This line prints the string in quotes and the value of the boolean
print "Is it greater or equal?", 5 >= -2
# This line prints the string in quotes and the value of the boolean
print "Is it less or equal?", 5 <= -2