Python Practice Questions For Class 8
Python Practice Questions For Class 8
1. Write a Python program to find those numbers which are divisible by 7 and
multiple of 5, between 1500 and 2700 (both included).
4. Write a Python program that accepts a word from the user and reverse it.
6. Write a Python program to find numbers between 100 and 400 (both
included) where each digit of a number is an even number.
7. Write a Python program to check whether an alphabet is a vowel or
consonant.
Expected Output:
Input a letter of the alphabet: k
k is a consonant.
9. Write a Python program to sum of two given integers. However, if the sum
is between 15 to 20 it will return 20.
11. Write a Python program that reads two integers representing a month and
day and prints the season for that month and day.
Expected Output:
Input the month (e.g. January, February etc.): july
Input the day: 31
Season is autumn
12. Write a Python program to find the median of three values.
Expected Output:
Input first number: 15
Input second number: 26
Input third number: 29
The median is 26.0
13. Write a Python program to create the multiplication table (from 1 to 10) of
a number.
Expected Output:
Input a number: 6
6 x 1 = 6
6 x 2 = 12
6 x 3 = 18
6 x 4 = 24
6 x 5 = 30
6 x 6 = 36
6 x 7 = 42
6 x 8 = 48
6 x 9 = 54
6 x 10 = 60
14. Write a Python program to construct the following pattern, using a nested
loop number.
Expected Output:
1
22
333
4444
55555
666666
7777777
88888888
999999999