Q 1. write a program to enter length and breadth and calculate area and display it.
l = int (input ("enter the length"))
b = int (input ("enter the breadth"))
a = l*b
print(" product of length and breadth =", a)
output:
enter the length 25
enter the breadth 32
product of length and breadth = 800
Q 2. write a program to get selling price and G.S.T rate then print invoice along with C.G.S.T and S.G.S.T values.
S = int (input ('enter selling price'))
G = int (input ('enter G.S.T rate'))
CGST= S*(G.S.T/2)*100
SGST= S*(G.S.T/2)*100
print(" SGST@", (G.S.T/2), "%=, "SGST)
output:
TRY YOURSELF.....
Q 3. write a program to enter a number find table upto 10 in pro proper format.
n = int (input ('enter a no='))
print(n,"*1 = ", n*1)
print(n,"*2 = ", n*2)
print(n,"*3 = ", n*3)
print(n,"*4 = ", n*4)
print(n,"*5 = ", n*5)
print(n,"*6 = ", n*6)
print(n,"*7 = ", n*7)
print(n,"*8 = ", n*8)
print(n,"*9 = ", n*9)
print(n,"*10 = ", n*10)
output:
2*1=2
2*2=4
2*3=6
2*4=8
upto till 10
TRY YOURSELF...
Q 4. write a program to input two number and display the quotient and remainder in different line.
a=int(input('enter a no'))
b=int(input('enter other no'))
q=a//b
r=a%b
print("quotient=", q)
print("remainder=",r)
output:
Try yourself...
Working with maths module:
Some mathematical function in math module -
- sqrt()
- exp()
- floor()
- log()
- log10()
- pow()
- sin()
- cos()
- tan()
- ceil()
Q 4. write a program to input principle, rate and time then calculate simple interest.
p= float(input('enter the principle'))
r= float(input('enter the rate'))
t= float(input('enter the time'))
S.I= (p*r*T)/100
print("the simple interest=",S.I)
output
Try yourself...
Q 5. Write the corresponding python expression for the following mathematical operation.
- a2+b2+c2
print(sum)
Some more examples based on mathematics module :
0 Comments