Selection Programming(If-else)
Selection Programming(If-else)
Write a Python program to input three numbers and display the greatest and smallest among them
using only if-else.
2. Take a 4-digit number and determine whether the sum of the first two digits is equal to the sum of
the last two digits.
3. Write a Python program to accept marks in 5 subjects, calculate the percentage, and assign a grade
using conditions:
100–90: A1
80–89: A2
70–79: B1
60–69: B2
50–59: C1
40–49: C2
4. Input a year and check if it is a leap year and also check whether it is a century year or not.
5. Create a program to input time in 24-hour format and convert it to 12-hour format with proper AM or
PM label.
6. Take input for three sides of a triangle and check whether the triangle is:
Valid
≤ 0: Freezing
1–10: Cold
11–25: Pleasant
26–35: Warm
35: Hot
8. Input a character and check whether it is a vowel, consonant, or invalid (e.g., number or special
character).
9. Input a number and check whether it is divisible by both 5 and 7, by either one, or none.
10% if 5000–9999
5% if 1000–4999
No discount otherwise