You are on page 1of 3

1.

N=float(input('Enter distance covered per day (in Kms): '))

M=float(input('Enter total length of route (in Kms): '))

days=M/N

print('The distance is covered in {0} days '.format(days))

2. num=int(input('Enter a 3 digit no.: '))

n1=num%10

num=num/10

n2=num%10

num=num/10

n3=num%10

total=int(n1+n2+n3)

print('Sum of digits= ',total)

3. B=int(input('Enter length of base of triangle: '))

H=int(input('Enter height of triangle: '))

ar=B*H

ar=ar/2

print('Area = ',ar)

4. n1=int(input('Enter 1st no.: '))

n2=int(input('Enter 2nd no.: '))

n3=int(input('Enter 3rd no.: '))

s=n1+n2+n3

1
avg=s/3

print('Average of the 3 nos. is ',avg)

5. num=int(input('Enter the no,: '))

if num%2==0:

print('It is even')

else:

print('It is odd

6. C=int(input('Enter temp in Celcius: '))

F=(9/5*C)+32

print('Temp in Farenheit= ',F)

7. n1=int(input('Enter 1st no.: '))

n2=int(input('Enter 2nd no.: '))

n3=int(input('Enter 3rd no.: '))

if n1>n2 and n1>n3:

maxm=n1

elif n2>n1 and n2>n3:

maxm=n2

else:

maxm=n3

print('Max=',maxm)

if n1<n2 and n1<n3:

2
minn=n1

elif n2<n1 and n2<n3:

minn=n2

else:

minn=n3

print('Min= ',minn)

You might also like