0% found this document useful (0 votes)
2 views

if elif else python test quiz solve

The document outlines ten programming tasks that involve user input and conditional logic. Tasks include determining age categories, converting numerical grades to letter grades, finding the largest of three numbers, identifying months by number, checking leap years, determining even or odd numbers, validating passwords, calculating BMI, simulating a rock-paper-scissors game, and calculating taxes based on income. Each task emphasizes basic programming concepts such as conditionals, input handling, and arithmetic operations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

if elif else python test quiz solve

The document outlines ten programming tasks that involve user input and conditional logic. Tasks include determining age categories, converting numerical grades to letter grades, finding the largest of three numbers, identifying months by number, checking leap years, determining even or odd numbers, validating passwords, calculating BMI, simulating a rock-paper-scissors game, and calculating taxes based on income. Each task emphasizes basic programming concepts such as conditionals, input handling, and arithmetic operations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

Write a program that asks the user to enter their age and determines whether they are a child,
teenager, adult, or senior citizen.

2. Create a program that prompts the user to enter a grade from 0 to 100 and then prints a
corresponding letter grade using the following scale: 90-100 (A), 80-89 (B), 70-79 (C), 60-69 (D),
below 60 (F).

3. Write a program that takes three numbers as input and finds the largest among them using if, elif,
and else statements.

4. Create a program that asks the user to enter a month number (1-12) and prints the corresponding
month name. Handle invalid inputs with an appropriate error message.

5. Write a program that prompts the user to enter a year and checks if it is a leap year or not. Display
an appropriate message.

6. Create a program that determines whether a given number is even or odd. If the number is
divisible by 4, print a different message.

7. Write a program that asks the user to enter a password. If the password matches a predefined
secret password, display a success message. Otherwise, inform the user that the password is
incorrect.

8. Create a program that takes a user's height (in feet and inches) and weight (in pounds) as input,
and calculates their body mass index (BMI) using the following formula: BMI = (weight / (height *
height)) * 703. Display the BMI along with the corresponding weight category (e.g., underweight,
normal weight, overweight, obese).

9. Write a program that simulates a simple game of rock, paper, scissors. Prompt the user for their
choice and randomly generate a choice for the computer. Determine the winner and display the
result.

10. Create a program that asks the user to enter their income. Based on their income, calculate and
display the amount of tax they need to pay using different tax brackets.

You might also like