0% found this document useful (0 votes)
2 views2 pages

Simple Python Questions

The document outlines five exercises for programming in Python. Each exercise involves user input and basic calculations, including age calculation, distance conversion, rectangle measurements, total cost calculation, and BMI computation. The exercises aim to practice fundamental programming concepts and user interaction.

Uploaded by

k59kitchen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Simple Python Questions

The document outlines five exercises for programming in Python. Each exercise involves user input and basic calculations, including age calculation, distance conversion, rectangle measurements, total cost calculation, and BMI computation. The exercises aim to practice fundamental programming concepts and user interaction.

Uploaded by

k59kitchen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Exercise 1:

Write a program using Python that:


• asks the user to enter their year of birth
• asks the user to enter a year in the future
• calculates the age the user will be in the second year entered
• outputs this age in an appropriate message

Exercise 2:
Write a program using Python that:
• takes a distance as input in miles (allow a decimal input)
• converts the distance to kilometres (include decimal places)
(kilo = miles x 1.609344)
• outputs the calculated distance in an appropriate message

Exercise 3:
Write a program using Python that:
• asks the user to enter width of rectangle
• asks the user to enter height of rectangle
• calculates the perimeter and area of rectangle
• outputs in an appropriate message
Exercise 4:
Write a program using Python that:
• asks the user to enter the price of item
• asks the user to enter the quantity of that item
• calculates the total cost of item
• outputs this total cost in an appropriate message

Exercise 5:
Write a program using Python that:
• asks the user to enter their weight in kilograms
• asks the user to enter their height in meters
• calculates the Body Mass Index (BMI) using the formula:
BMI = weight / (height * height)
• outputs this BMI value in an appropriate message

You might also like