60% found this document useful (10 votes)
18K views3 pages

Python Practice Questions For Class 8

The document provides 14 Python coding exercises involving tasks such as finding numbers divisible by 7 and multiples of 5 between two ranges, converting temperatures between Celsius and Fahrenheit, constructing patterns using nested loops, reversing words, calculating the Fibonacci series, finding even digit numbers between two ranges, determining if letters are vowels or consonants, converting month names to number of days, calculating sums between two ranges, determining triangle types based on side lengths, determining seasons based on month and date, calculating medians of three numbers, creating multiplication tables, and constructing nested patterns of increasing numbers.

Uploaded by

Rashmi Kumari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
60% found this document useful (10 votes)
18K views3 pages

Python Practice Questions For Class 8

The document provides 14 Python coding exercises involving tasks such as finding numbers divisible by 7 and multiples of 5 between two ranges, converting temperatures between Celsius and Fahrenheit, constructing patterns using nested loops, reversing words, calculating the Fibonacci series, finding even digit numbers between two ranges, determining if letters are vowels or consonants, converting month names to number of days, calculating sums between two ranges, determining triangle types based on side lengths, determining seasons based on month and date, calculating medians of three numbers, creating multiplication tables, and constructing nested patterns of increasing numbers.

Uploaded by

Rashmi Kumari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

CLASS – VIII

LAB EXCERCISE (PYTHON)

1. Write a Python program to find those numbers which are divisible by 7 and
multiple of 5, between 1500 and 2700 (both included).

2. Write a Python program to convert temperatures to and from celsius,


fahrenheit.
[ Formula : c/5 = f-32/9 [ where c = temperature in celsius and f = temperature
in fahrenheit ]
Expected Output :
60°C is 140 in Fahrenheit
45°F is 7 in Celsius

3. Write a Python program to construct the following pattern, using a nested


for loop.
*
* *
* * *
* * * *

4. Write a Python program that accepts a word from the user and reverse it.

5. Write a Python program to get the Fibonacci series between 0 to 50.


Note : The Fibonacci Sequence is the series of numbers :
0, 1, 1, 2, 3, 5, 8, 13, 21, ....
Every next number is found by adding up the two numbers before it.
Expected Output : 1 1 2 3 5 8 13 21 34

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.

8. Write a Python program to convert month name to a number of days.


Expected Output:
List of months: January, February, March, April, May, June,
July, August
, September, October, November, December
Input the name of Month: February
No. of days: 28/29 days

9. Write a Python program to sum of two given integers. However, if the sum
is between 15 to 20 it will return 20.

10. Write a Python program to check a triangle is equilateral, isosceles or


scalene.
Note :
An equilateral triangle is a triangle in which all three sides are equal.
A scalene triangle is a triangle that has three unequal sides.
An isosceles triangle is a triangle with (at least) two equal sides.
Expected Output:
Input lengths of the triangle sides:
x: 6
y: 8
z: 12
Scalene triangle

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

You might also like