Intermediate Challenges: If-Else + For Loop (Python)
1. Print all numbers from 1 to 100. For multiples of 3, print "Fizz";
for multiples of 5, print "Buzz"; and for multiples of both, print "FizzBuzz".
2. Take an integer n as input. Print all prime numbers from 2 to n.
3. Given a list of integers, count how many are positive, negative, and zero.
4. Write a program that checks numbers from 1 to 50.
- If the number is even, print "<number> is even"
- If odd, print "<number> is odd"
5. Take a string input. Print only the vowels in the string, one per line.
6. For numbers 1 to 30:
- If divisible by 4, print "Div by 4"
- Else if divisible by 6, print "Div by 6"
- Else print the number itself
7. Write a program that prints the factorial of a number n using a for loop.
8. Given a list of integers, print only those that are divisible by both 2 and 3.
9. Take a sentence as input. Count how many words have more than 5 letters.
10. From 1 to 100, print all numbers but skip those divisible by 7.