5th grade
Chapter - Python
1. Write a program to find the product of two numbers x and y, where x and y
needs to be taken as input from user.
2. Create a program in Python to convert miles into kilometers.
▪ 1 Mile =1.6 Kilometers
3. Write a program to take name, class and age as input from user and display
in following format:
Name:abc
Class:V
Age:10
4. Write a program to calculate total discount on purchase of desktops and
laptops. Display the discounted rate of both. Cost of the Laptop and the
Desktop to be taken from user in 1 single input statement.
▪ On laptops –Discount = 10%
▪ On Desktop – Discount = 5%
please I need the correct answers of all questions urgently
Answers
Answer:
1) x = int(input("Enter the value of x"))
y = int(input("Enter the value of y"))
print(x*y)
2) miles_value = int(input("Enter distance in miles")
kilometer_value = miles_value*1.6
print(kilometer_value)
3) name = input("What's your name?")
class = int(input("Which class do you study in (Enter grade in numbers)"))
age = int(input("What's your age (Enter age in numbers)"))
print("Name: ",name)
print("Class: ",class)
print("Age: ",age)
4) lap_price, desk_price = map(int, input("Enter laptop price and desktop price with a space inbetween").split())
laptop_discounted_price = lap_price-((10/100)*lap_price)
print(laptop_discounted_price)
desktop_discounted_price = desk_price-((5/100)*desk_price)
print(desktop_discounted_price)
Hope it helped! Plz mark as brainliest!!