0% found this document useful (0 votes)
35 views4 pages

Class 8 Winter Worksheet Question

The document contains a 20 question multiple choice quiz on Python programming concepts like variables, operators, conditionals, loops, functions and basic syntax. It also contains 6 short programming problems to write Python code to print out various numeric series.

Uploaded by

Aviral
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views4 pages

Class 8 Winter Worksheet Question

The document contains a 20 question multiple choice quiz on Python programming concepts like variables, operators, conditionals, loops, functions and basic syntax. It also contains 6 short programming problems to write Python code to print out various numeric series.

Uploaded by

Aviral
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CH.

CHHABIL DASS PUBLIC SCHOOL (MIDDLE WING)


WINTER HOLIDAY WORKSHEET
CLASS-VIII
SUBJECT- COMPUTER

Multiple choice question:


1) Who developed Python Programming Language?
a) Wick van Rossum c) Guido van Rossum
b) Rasmus Lerdorf d) Niene Stom

2) Which of the following is the correct extension of the Python file?


a) .python c) .py
b) .pl d) .p

3) What will be the output of following program:-


sum =0
for i in range(10,2,-2):
sum=sum+i
print(sum)
a) 35 c) error
b) 28 d) none of these

4) What will be the value of the following Python expression?


4+3*5
a) 19 c) 20
b) 35 d) 10

5) What are the values of the following Python expressions?


2**(3**2)
(2**3)**2
2**3**2
a) 512, 64, 512 c) 64, 512, 64
b) 512, 512, 512 d) 64, 64, 64

6) what is the output of the following program :-


factorial=1
num=5
for x in range(1,num+1):
factorial=factorial*x
print(“the factorial of ”,num, “is :”, factorial)
a) The factorial of 5 is :120 c) The factorial of 5 is :125
b) The factorial of 5 is :130 d) The factorial of 5 is :100
7) What will be the output of the following code ?
so= se=0
for x in range (1,6):
if x%2==0:
se+=x
else:
so+=x
print(se)
print(so)
a) 098,149 c)026,247
b)026,149 d)098,249

8) What will be the output of the following expression in Python ?


“2 ** 3 + 5 ** 2”
a) 33 c) 169
b) 65536 d) None of these

9) What will be the output of the following code ?


a=3
b=1
print(a, b)
a, b = b, a
print(a, b)
a) 3 1 1 3 c) 1 3 3 1
b) 3 1 3 1 d) 1 3 1 3

10) What will be the output of following program:-


sum=0
for x in range(21,31):
sum=sum+x
print("sum=",sum)

a)225 c)None of these


b)255 d)error

11) Study the following program:


n= 5
sum=0
for x in range (1,n):
sum+=x
print (sum ,end= “ ”)
What will be the output of this program?
a) 1 3 6 10 c) 1 6 12 24
b) 1 2 3 4 d) 1 2 5 10
12) Which of the following arithmetic operators cannot be used with strings in python?
a) + c) –
b) * d)All of the mention

13 )What will be the output of the range function?


Range (2,10,3)
a) 2,4,6 c) 2,5,8
b) 2,5,7 d) 2,4,8

14)What will be the output of following program:-


num = 10
if(num % 2 == 0):
print(num,"=is even")
else:
print(num,"= is odd")
a)10=is even c)error
b)10=is odd d)even is=num

15) Study the following program:


print(6 + 5 - 4 * 3 / 2 % 1)
What will be the output of this program?
a) 7 c) 15
b) 9 d) 11

16)A/ An ________________is a whole number without any decimals or fractional parts.


a) Integer c) String
b) Float d) None of these

17) If a = int (20.95) is a statement in Python , what is the value assigned to the
variable a?
a) 20.95 c) 95
b) 21 d) 20

18)what will be the output of the following python program?


x= 146
y= 636
if y>x:
print(“y is greater than x”)
else :
print(“x is greater than y”)
a) y is greater than x c) 636 is greater than 146
b) x is greater than y d) 146 is greater than 636

19) What will be the output of the following python program ?


For x in range (0,10,2):
print (x, end = “ ”)
a) 0,10,2 c) 0,2,4,6,8,10
b) 0 2 4 6 8 d) 0,2,4,6,8,
20) What will be the output of the following python program?
x= 789
y= 636
if y>x:
print(“y is greater than x”)
else :
print(“x is greater than y”)
a) y is greater than x c) 636 is greater than 789
b) x is greater than y d) 789 is greater than 636

Write the program given below :

1. Write a program in python to print the numbers from 1 to 10.


2. Write a program in python to print the following series:
1 3 5 7 9 11….
3. Write a program in python to display the vales from 10 to 1.
10 9 8 7 6 5 4 3 2 1
4. Write a program in python to print all natural numbers from 21 to 30.
5. Write a program in python to display the following series:
2 4 6 8 10 12 14 16 18 20.
6. Write a program in python to display the following series which is separated from
coma(,):
2, 4, 6 , 8 , 10, 12, 14 , 16, 18, 20.

You might also like