Computer HW
Computer HW
IX - A
if ch == 1:
print(km*1000,'m')
elif ch == 2:
print(km*100000,'cm')
PROGRAM 2
num1 = float(input('Print first number: '))
num2 = float(input('Print second number: '))
ch = float(input('Enter 1 for addition, 2 for subtraction, 3 for multiplication, 4
for division. Enter your choice: '))
if ch == 1:
print(num1+num2)
elif ch == 2:
print(num1-num2)
elif ch == 3:
print(num1*num2)
elif ch == 4:
print(num1/num2)
else:
print('You are not eligible to vote, please come back when you are
older')
PROGRAM 4
gr = int(input('Please enter your percentage: '))
if gr >= 90:
print('You have scored an A grade.')
elif num == 0:
print('THe number is a zero.')