Professional Documents
Culture Documents
1 Introduction to Python
1.1 Mathematical Operations
[ ]: print("Hello World!")
[ ]: print('Hello World!')
[ ]: 'Hello World!'
[ ]: 6834 + 57
[ ]: 6834 * 57
[ ]: 6834 / 57
Quotient-Remainder calculations
[ ]: 6834 // 57 # Returns quotient
[ ]: a = 6834
b = 57
[ ]: print(a,b)
[ ]: q = a//b
r = a%b
print(q,r)
[ ]: b*q+r == a
[ ]: 27**5
1
[ ]: 27**50
[ ]: 27**500
[ ]: 27**10000
[ ]: 27**100000
[ ]: 27**(0.5)
[ ]: P = 20000
r = 5.5
t = 5
Amount1 = P+ P*r*t/100
Amount2 = P*(1+ r/100)**t
print(Amount1)
print(Amount2)
[ ]: print(f'The return with simple interest at {r}% after {t} years is Rs.{Amount1}.
,→')
[ ]: print(f'The return with compound interest at {r}% after {t} years is Rs.
,→{Amount2}.')
[ ]: print(f'The return with compound interest at {r}% after {t} years is Rs.{Amount2:
,→6f}.')
[ ]: print(f'The return with compound interest at {r}% after {t} years is Rs.{Amount2:
,→.10}.')