Untitled Document
Untitled Document
print("area of rectangle")
a=int(input("enter the length="))
w=int(input("enter the width="))
print("area of the rectangle=",(a*w))
Output:
area of rectangle
enter the length=20
enter the width=25
area of the rectangle= 500
2.area of square
print("area of square")
s=int(input("enter the length of the side="))
print("area of sqaure=",(s*s))
Output:
area of square
enter the length of the side=15
area of sqaure= 225
3.area of circle
print("area of circle")
r=int(input("enter the radius of circle="))
print("area of circle=",(3.14*r*r))
Output:
area of circle
enter the radius of circle=8
area of circle= 200.96
4.area of triangle
print("area of triangle")
h=int(input("enter the height="))
b=int(input("enter the base="))
print("area of triangle=",(0.5*b*h))
Output:
area of triangle
enter the height=20
enter the base=10
area of triangle= 100.0
Coding:
print("temperature conversion")
print("a=from fahrenhit to celcius")
print("b=from celcius to fahrenheti")
choice=input("enter your choice (a/b):")
t=float (input("enter the temperature:"))
if choice.lower()=='a':
print("fahrenheti to calcius:", (t-32)*5/9)
else:
print("celcius to fahrenheit:", (t*9/5)+32)
Output:
temperature conversion
a=from fahrenhit to celcius
b=from celcius to fahrenheti
enter your choice (a/b):a
enter the temperature:470
fahrenheti to calcius: 243.33333333333334
temperature conversion
a=from fahrenhit to celcius
b=from celcius to fahrenheti
enter your choice (a/b):b
enter the temperature:120
celcius to fahrenheit: 248.0
Coding:
p=int(input("enter the principal
amount"))
n=int(input("enter the time"))
r=int(input("enter the rate of intrest"))
SI=p*n*r/100
CI=p*1+r/100*n
print(CI)
Output:
Output:
enter your marks eng:77
enter your marks dbms:88
enter your marks computer science:76
enter your marks os:96
enter your marks iks:100
your grade is:b
total marks are:437.0
total percentage are :87.4%
Output:
enter a numbr:13
13 is an odd number.
6.print 1 to 10 numbers
for i in range(1,11):
print(i)
Output:
1
2
3
4
5
6
7
8
9
10