Conditional Scripts Python 3_Conditional and Looping Statements Exercise 1 Name your file: MonthNames.py Write a program that reads an integer value between 1 and 12 from the user and prints output the corresponding month of the year. An example run of the program (numbers in bold are typed in by the user) Enter the month: 3 Month 3 is March
Exercise 2 A certain cinema currently sells tickets for a full price of 6 pounds, but always sells tickets for half price to people who are less than 16 years old, and for a third of the price for people who are 60 years old or more. An example run of the program (numbers in bold are typed in by the user) Enter your age: 63 Your ticket costs £2.00
Exercise 3 Name your file: BodyMassIndex.py Write a program to calculate your BMI and give weight status. Body Mass Index (BMI) is an internationally used measurement to check if you are a healthy weight for your height.The metric BMI formula accepts weight in kilograms and height in meters: BMI= weight(kg)/height2(m2) BMI Weight Status Categories table BMI range - kg/m2 Category Below 18.5 Underweight 18.5 -24.9 Normal 25 - 29.9 Overweight 30 & Above Obese An example run of the program (numbers in bold are typed in by the user) Enter your weight in (kg): 75 Enter your height in (m): 1.70 Your BMI is: 25.95 You are in the “overweight” range.
Exercise 4 Write a Python program to receive 3 numbers from the user and print the greatest among them.
Exercise 5 Find the factorial of a given number using loops(note the number is received from the user)
Exercise 6 Reverse a number using while loop
Exercise 7 Finding the multiples of a number using loop
Exercise 8 Write a program to print the inputted value as it is and break the loop if the value is 'done'. Example run of the program :hello there hello there :finished finished :done Done
Exercise 9 Write a program that prints the numbers from 1 to 10. But for multiples of three print Fizz instead of the number and for the multiple of five print Buzz. For numbers which are multiples of both three and five print FizzBuzz
Exercise 10 Write a program to print the following pattern:
5 4 3 2 1 4 3 2 1 3 2 1 2 1 1