Python Worksheet – Grade 7
Q1. Write a program that asks the user to enter a number.
- If the number is divisible by 2, display "Even number".
- Otherwise, display "Odd number".
Q2. Write a program that asks the user to enter a number.
- If the number is divisible by 4 and 6, display "Divisible by both".
- If divisible only by 4, display "Divisible by 4".
- If divisible only by 6, display "Divisible by 6".
- Otherwise, display the number itself.
Q3. Write a program that asks the user to enter any word.
- If the word starts with a vowel, display "Vowel word".
- Otherwise, display "Consonant word".
Q4. Write a program that asks the user to enter two numbers.
- If the first number is greater than the second, display "First is bigger".
- If the second number is greater, display "Second is bigger".
- If both are equal, display "Both are equal".
Q5. Write a program that asks the user to enter a number.
- If the number is less than 0, display "Negative".
- If the number is equal to 0, display "Zero".
- If the number is greater than 0, display "Positive".
Q6. Write a program that asks the user to enter a year.
- If the year is a leap year, display "Leap Year".
- Otherwise, display "Not Leap Year".
Q7. Write a program that asks the user to enter a number.
- If the number is between 1 and 10, display "Small number".
- If the number is between 11 and 100, display "Medium number".
- If the number is greater than 100, display "Large number".
Q8. Write a program that asks the user to enter a sentence.
- Count and display the number of vowels in the sentence.
Q9. Write a program that asks the user to enter a number.
- Print the multiplication table of that number up to 10.
Q10. Write a program that asks the user to enter a number.
- If the number is a palindrome (same forward and backward), display "Palindrome".
- Otherwise, display "Not Palindrome".