python test paper
python test paper
6. Grade Calculator
Write a program that takes a student's percentage as input and prints the
corresponding grade:
- 90+ → A
- 80-89 → B
- 70-79 → C
- 60-69 → D
- <60 → Fail
7. Check Divisibility
Write a program to check whether a number is divisible by both 5 and 7.
8. Absolute Difference
Write a program that calculates the absolute difference between a number and 21. If
the number is greater than 21, print double the absolute difference.
8. Temperature Check
Write a program that takes a temperature as input and prints:
- "Very Cold" if below 10°C
- "Cold" if 10-20°C
- "Warm" if 21-30°C
- "Hot" if above 30°C