Asmt 3
Asmt 3
1.Write a Python program that takes a temperature input in Celsius from the user and converts it to
Fahrenheit or Kelvin based on the user's choice. Use `if-elif-else` to handle the conversion options.
2.Write a Python program that takes a numerical grade as input and prints out the corresponding letter
grade based on the following scale:
- A: 90-100
- B: 80-89
- C: 70-79
- D: 60-69
- F: below 60
3.Write a Python program that asks the user for their age and prints out their life stage based on the
following categories:
4.Write a Python program that simulates a traffic light. The user inputs the current light color (red,
yellow, green), and the program outputs the next light color.
5.Write a Python program that calculates the Body Mass Index (BMI) and categorizes the result into
Underweight, Normal weight, Overweight, and Obese using the following BMI ranges:
6.Write a Python program that checks if a given year is a leap year. Use `if-elif-else` statements to
handle the conditions for a leap year.
7.Write a Python program that takes two numbers and an operator (+, -, *, /) as input and performs the
corresponding arithmetic operation. Use `if-elif-else` to handle the different operations.
8.Write a Python program that takes the lengths of three sides of a triangle as input and determines
whether the triangle is Equilateral, Isosceles, or Scalene.
9.Write a Python program that takes an integer (1-7) as input and prints the corresponding day of the
week. Use `if-elif-else` to map the numbers to days.
10.Write a Python program that takes a password as input and evaluates its strength based on length
and the presence of uppercase letters, lowercase letters, digits, and special characters. Use `if-elif-else`
to categorize the password as Weak, Moderate, or Strong.