a = 20.5
b = 6.4
print "a = ", a
print "b = ", b
print "a+b = ", (a+b)
print "a-b = ", (a-b)
print "a*b = ", (a*b)
print "a/b = ", (a/b)
print "a%b = ", (a%b)
a = 15.0
b = 20.75
c = 15.0
print "a = ", a
print "b = ", b
print "c = ", c
print "a<b is ", (a<b)
print "a>b is ", (a>b)
print "a==c is ", (a==c)
print "a<=c is ", (a<=c)
print "a>=b is ", (a>=b)
print "b!=c is ", (b!=c)
print "b==(a+c) is ", (b==(a+c))
#there is no inrement operator in Python, we will use += instead
m = 10
n = 20
print "m = ", m
print "n = ", n
m+=1
print "++m = ", m
print "n++ = ", n
n+=1
print "m = ", m
print "n = ", n
my_sum = 0
for i in range(1, 11):
my_sum = my_sum + (1/float(i))
print "i = ", i,
print "sum = ", my_sum
my_list = []
my_list.append(1)
my_list.append(2)
l = len(my_list)-1
total = 0
while l >= 0:
total = total + my_list[l]
l -= 1
print "The total amount is ", total
a = 10
b = 5
c = 8
d = 2
x = 6.4
y = 3.0
answer1 = a * b + c / d
answer2 = a * (b+c) / d
answer3 = a/c
answer4 = float(a)/c
answer5 = a / y
answer6 = a % c
answer7 = float(x%y)
bool1 = a > b and c > d
bool2 = a < b and c > d
bool3 = a < b or c > d
bool4 = not(a - b == c)
print "Order of Evaluation"
print "a * b + c / d = ", answer1
print "a * (b+c) / d = ", answer2
print "Type Conversion"
print "a / c = ", answer3
print "float(a)/c = ", answer4
print "a / y = ", answer5
print "Modulo Operations"
print "a % c = ", answer6
print "x % y = ", answer6
print "Logical Operations"
print "a > b and c > d = ", bool1
print "a < b and c > d = ", bool2
print "a < b or c > d = ", bool3
print "not(a - b == c) ", bool4