These are 35 programming questions on if-else, if-elif-else,
for loop, and while loop in Python
1) Write a program to check if a given number is even or odd.
2) Write a program to check if a given number is positive, negative, or zero.
3) Write a program to check if a given year is a leap year or not.
4) Write a program to check if a given character is a vowel or consonant.
5) Write a program to check if a given number is a prime number or not.
6) Write a program to find the largest of three numbers.
7) Write a program to find the smallest of three numbers.
8) Write a program to check if a given number is a palindrome or not.
9) Write a program to check if a given string is a palindrome or not.
10) Write a program to calculate the factorial of a given number.
11) Write a program to find the sum of all numbers in a given list.
12) Write a program to find the product of all numbers in a given list.
13) Write a program to find the maximum number in a given list.
14) Write a program to find the minimum number in a given list.
15) Write a program to find the second largest number in a given list.
16) Write a program to find the second smallest number in a given list.
17) Write a program to print all prime numbers in a given range.
18) Write a program to print the Fibonacci sequence up to a given number.
19) Write a program to reverse a given string.
20) Write a program to count the number of vowels in a given string.
21) Write a program to count the number of words in a given string.
22) Write a program to remove duplicates from a given list.
23) Write a program to find the intersection of two given lists.
24) Write a program to find the union of two given lists.
25) Write a program to Check if all keys of one dictionary exist in another dictionary.
26) Write a program to Find the maximum and minimum elements in a set.
27) Write a program to check if a given string is a valid email address or not.
28) Write a program to Check if two sets have any common elements.
29) Write a program to find the LCM of two given numbers.
30) Write a program to count the number of digits in a given number.
31) Write a program to find the sum of the digits in a given number.
32) Write a program to find the reverse of a given number.
33) Write a program to print the multiplication table of a given number.
34) Write a program to print the first n terms of the geometric sequence 2, 6, 18, 54, ...
35) Write a program to Sort a dictionary by value.