-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex3.py
39 lines (25 loc) · 941 Bytes
/
ex3.py
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
print "I will count my chickens:"
print "Hens",25+30/6
print "Roosters", 100-25*3%4
print "Now I will count the eggs:"
print 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6
print "Is it true that 3 +2 < 5 - 7?"
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 is false."
print "How about some more."
print "Is it greater", 5 > -2
print "Is it greater or equal?", 5 >= -2
print "Is it less or equal?", 5 <= -2
print "**************************************"
print "from now onwards bucky portion is there: "
# integer divides by integer is always integer,,
print "18/3: ", 18/3
print "18/7: ", 18/7
#python's modulus even works for decimal numbers..
print "18.75 % 0.5: ", 18.75 % 0.5
#python provides us exponent operator directly:
print "5**2: ", 5**2
#exponent operator also works id the base is negative:
print "-5**2: ", -5**2, "#Note that -5 squared is not a positive number here"