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

Python Conditional Statements Questions

Uploaded by

mahek032004
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)
2 views2 pages

Python Conditional Statements Questions

Uploaded by

mahek032004
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

Python Conditional Statements - Questions

1. Write a Python 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 Python program to check whether a person is eligible to vote or not.

4. Write a program to find the largest of two numbers.

5. Write a Python program to find the largest among three numbers.

6. Write a program to check whether a number is divisible by both 3 and 5.

7. Write a Python program to check whether a given year is a leap year or not.

8. Write a program to display grade of a student based on marks entered by the user.

9. Write a Python program to build a simple calculator using if-elif-else.

10. Write a program to check if a person is eligible for a driving license based on age.

11. Write a Python program to check if a number is positive, negative, or zero, and if it is positive,

check whether it is even or odd.

12. Write a program to input marks and display the grade using nested if-else.

13. Write a program to check whether an entered character is an alphabet, digit, or special

character.

14. Write a program to check if a number is positive and multiple of 5 using nested if.

15. Write a program to check if a given triangle is valid based on its three angles.

16. Write a Python program to check whether a string is a palindrome.

17. Write a program to check whether a given character is a vowel or consonant.

18. Write a Python program to check whether the word 'python' is present in a given sentence.

19. Write a program to check the length of a string and display whether it is short, medium, or long.

20. Write a Python program to compare two strings and check if they are equal (case-insensitive).
21. Write a program to check whether a given string starts with a vowel or a consonant.

22. Write a Python program to count uppercase, lowercase, digits, and special characters in a string.

23. Write a program to check if the first and last characters of a string are the same.

24. Write a program to check if a string contains only alphabets or includes numbers/special

symbols.

25. Write a Python program to classify a string as uppercase, lowercase, or mixed case.

You might also like