You are on page 1of 2

Ques. Write a program to convert someone’s weight from pound to kg.

Ask
the user to enter their weight in either pound or kg and thn convert it into
another unit.

Ans.

pounds = float(input('Enter weight in Pounds to Convert into Kilograms:'))

kilo_grams = pounds * 0.453592

print(pounds,' Pounds are equal to', kilo_grams,'Kilograms (Kgs)')

Ques. If name is less than 3 characters long Print Name must be at least 3
char Otherwise if it’s more than 50 chars long Print Name can be a max of
50 characters Otherwise Print name looks good

Ans:

s=(input('Enter Your Name-'));

l=len(s);

if l<3:

print("Name must be atleast 3 Character")

elif l>50:

print("Name must be atmost 50 Character")

else:

print('Name looks Good')

Ques. Price of a house is $1M. If buyer has good credit, they need to put
down 10% otherwise they need to put down 20%. print the down Payment.
(Use formatted string)

Ans:

print('Price of house = $1M')


p1=float((1000000*10)/100)

p2=float((1000000*20)/100)

ch=(input('Enter Credits (G for good Otherwise A):'))

if ch=='G':

print('Down Payment= ',p1)

elif ch=='A':

print('Down Payment= ',p2)

else:

print('Wrong Input')

You might also like