0% found this document useful (0 votes)
6 views1 page

Program Question

The document lists various Python conditional statement programs that cover a range of topics including number classification, eligibility checks, and calculations. Each program addresses a specific problem, such as determining if a number is positive or negative, checking for even or odd numbers, and calculating bonuses and discounts based on given criteria. The programs serve as practical examples for learning and applying conditional logic in Python.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Program Question

The document lists various Python conditional statement programs that cover a range of topics including number classification, eligibility checks, and calculations. Each program addresses a specific problem, such as determining if a number is positive or negative, checking for even or odd numbers, and calculating bonuses and discounts based on given criteria. The programs serve as practical examples for learning and applying conditional logic in Python.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Python Conditional Statement Programs

1. Write a program to check whether a number is positive, negative, or zero.


2. Write a program to check whether a number is even or odd.
3. Write a program to find the largest of two numbers.
4. Write a program to find the largest of three numbers using if-elif-else.
5. Write a program to check whether a person is eligible to vote or not.
6. Write a program to check whether a year is a leap year or not.
7. Write a program to check whether a character is a vowel or consonant.
8. Write a program to check whether a student has passed or failed. (Pass marks = 33)
9. Write a program to calculate bonus:
Salary > 50000 → 10% bonus
Otherwise → 5% bonus
10. Write a program to display grade according to marks:
90+ → A
75–89 → B
50–74 → C
Below 50 → Fail
11. Write a program to check whether a number is divisible by 5 and 11.
12. Write a program to check whether a person can get a driving license:
Age ≥ 18 → Eligible
Otherwise → Not Eligible
13. Write a program to check whether a triangle is valid or not using angle sum property.
14. Write a program to check whether a number is a 3-digit number or not.
15. Write a program to find the smallest among three numbers.
16. Write a program to calculate electricity bill:
Units ≤ 100 → ₹5/unit
Units > 100 → ₹8/unit
17. Write a program to check whether a character is uppercase or lowercase.
18. Write a program to check whether a number is divisible by both 2 and 3.
19. Write a program to calculate discount:
Purchase amount > 5000 → 20% discount
Otherwise → 10% discount
20. Write a program to input temperature:
Temp > 40 → “Hot”
Temp 20–40 → “Warm”
Below 20 → “Cold”

You might also like