Worksheet-Final
Class-8
1. Answer the following Questions.
1. What is networking?
2. Write syntax of the for loop.
3. How can we call a function in Python? Explain with example.
2. Write a program:
1. Print even numbers from 1 to 70 using for loop.
2. Calculate the product of even numbers from 12 to 20.
3. What will be the output of the following Python code?
1. m=4
while ( m < = 23 ):
print(“Hello”)
i=i+10
4. Correct the following statements:
1. for m in range (120, 40, 3)
2. for a in range (80, 33)
3. PRINT y
5. Do as directed.
If a=10, b=3 and C=20 then what will be the output of the following
statements.
1. p r i n t ( a > b a n d b < c )
2. p r i n t ( a * * b - c )
3. p r i n t ( a , b , c )
4. p r i n t ( a / / b + 3 - c )
5.print (a+b-c)*2
6. Name the following.
1. ________ is an expansion card which is used to provide the network access to a
computer.
_______.
2. SMTP stands for______________________.
Note: Attempt all questions and check the answer from the
given answer key.
Answer Key:
1. Read chapters (L-1, 8, 9) thoroughly for question-
answers, give one word , application based questions
etc.
2. Write a program:
1. Print even numbers from 1 to 70 using for loop.
2. Calculate the product of even numbers from 12 to 20.
Program:
1. for m in range(2, 71, 2):
print(m)
2. p=1
for m in range(12, 21, 2):
p=p*m
print(p)
3. What will be the output of the following Python code?
1. m=4
while ( m < = 23 ):
print(“Hello”)
m=m+10
Output is: Hello
Hello
4. Correct the following statements:
1. for m in range (120, 40, 3) = for
m in range(120, 40, -3)
2. for a in range (80, 33) = for a in range(80, 33, -1)
3. PRINT y = print y
5. Do as directed.
If a=10, b=3 and C=20 then what will be the output of the following
statements.
1. print (a>b and b<c)
print (10>3 and 3<20)
True True
Answer: TRUE
2. print (a **b -c) ** (Double Asterisk)
print (103 -20) raise to the power
((10X10X10)-20)
=1000-20
Answer: 980
3. p r i n t ( a , b , c ) = A n s w e r : 1 0 3 20
4. print (a//b+3-c) // (I neger division)
print (10//3+3-20)
= 3+3-20
= 9-20 = Answer: 11
5.print (a+b-c)*2
Print(10+3 -20)*2
= -7 *2= Answ e r : -1 4
6. Name the following.
1. NIC is an expansion card which is used to provide the network access to a
computer.
_______.
3. SMTP stands for Simple Mail Transfer Protocol
---------------------------------------------------------