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

Asmt 3

asmt4

Uploaded by

ABUTALIBHK
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)
7 views2 pages

Asmt 3

asmt4

Uploaded by

ABUTALIBHK
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
You are on page 1/ 2

26-07-2024 ASSIGNMENT

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:

- Child: 0-12 years

- Teenager: 13-19 years

- Adult: 20-64 years

- Senior: 65 years and above

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:

- Underweight: BMI < 18.5

- Normal weight: 18.5 <= BMI < 24.9

- Overweight: 25 <= BMI < 29.9

- Obese: BMI >= 30

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.

You might also like