You are on page 1of 2

#rs to $

a=float(input('enter the amount in Rs\n'))


b=a*0.0134217
print('the converted currency in $ is \n',b)

output
enter the amount in Rs
4556
the converted currency in $ is
61.1492652
----------------------------------------------------------------------------------

#distance runner problem


print('enter the distacne')
a=int(input('KM of total distance to be covered\n'))
b=int(input('M of total distance to be covered\n'))
c=a*1000+b
print('distance covered by each runner is \n',c/4)

output
enter the distacne
KM of total distance to be covered
5
M of total distance to be covered
34
distance covered by each runner is 1258.5
-----------------------------------------------------------------------------------
-
#length of diagonal
a=float(input('enter the perimeter\n'))
b=float(input('enter the length\n'))
#P = 2 * w + 2 * l w=p-2l/2
w=(a-2*b)/2
diagonal=(a*a+b*b)**0.5 #double ** for square root
print('the diagonal is\n',diagonal)

output
enter the perimeter
5
enter the length
5
the diagonal is
7.0710678118654755
-----------------------------------------------------------------------------------
-

#bmi
a=float(input('enter the weight(in pound)\n'))
b=float(input('enter the height(in inches)'))
c=a*0.453592 #pound to kg
d=b*0.0254 #inches to m
print('BMI is',(c/d*d))

output
enter the weight(in pound)
55
enter the height(in inches)
66
BMI is 24.94756
-----------------------------------------------------------------------------------
-

#hours worked in week


a=float(input('enter the duration of work on first day \n'))
b=float(input('enter the duration of work on second day \n'))
c=float(input('enter the duration of work on third day \n'))
d=float(input('enter the duration of work on fourth day \n'))
e=float(input('enter the duration of work on fifth day \n'))
print('average hours worked in a week is \n' , (a+b+c+d+e)/5)

output
enter the duration of work on first day
4
enter the duration of work on second day
5
6enter the duration of work on third day
7
enter the duration of work on fourth day
8
enter the duration of work on fifth day
9
average hours worked in a week is
6.6
-----------------------------------------------------------------------------------
-

You might also like