[go: up one dir, main page]

0% found this document useful (0 votes)
158 views2 pages

G-8 Computer Worksheet Answerkey

This document contains an answer key for a grade 8 computer worksheet on chapters 6 and 7, which cover conditional statements and loops in Python. 1) It provides the correct answers for multiple choice questions on conditional statements like if, for, and while loops. 2) It fills in the blanks for descriptions of while loops, infinite loops, and the break and continue statements. 3) It indicates whether statements about Python loops are true or false. 4) It defines jump statements and provides the syntax for for and while loops, demonstrating their use with examples.

Uploaded by

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

G-8 Computer Worksheet Answerkey

This document contains an answer key for a grade 8 computer worksheet on chapters 6 and 7, which cover conditional statements and loops in Python. 1) It provides the correct answers for multiple choice questions on conditional statements like if, for, and while loops. 2) It fills in the blanks for descriptions of while loops, infinite loops, and the break and continue statements. 3) It indicates whether statements about Python loops are true or false. 4) It defines jump statements and provides the syntax for for and while loops, demonstrating their use with examples.

Uploaded by

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

Grade- 8

Computer Worksheet
(Answer key)
Ch- 6 & 7
A. Tick ( ) the correct option.
1. Which of the following is a conditional statement in Python?
a. for statement b. while statement
c. if statement  d. break statement

2. Which of the following statements are used when the number of repetitions
are known?
a. for statement b. while statement
c. if…else statement d. continue statement

3. Which of the following statements skips the current iteration of a loop?


a. if b. for
c. break  d. continue

B. Fill in the blanks using the hints given below:


Hints: infinite, break, while, continue, non-zero, zero
1. The ……… while ….…… statement executes a set of statements repeatedly, until the
logical expression remains true.

2. Any ……… non-zero ….…… value in the while loop indicates an always true condition
whereas zero indicates ………False….…… condition.

3. The ……… infinite ….…… loop never ends.

4. The …… break …….…… and ……… continue ….…… are the jump statements in
Python.

C. Write ‘T’ for true and ‘F’ for false.

1. We cannot use do-while loop in Python. F

2. The break statement breaks the loops one by one. T


3. The continue is a keyword in Python which is used for bringing the
program control out of the loop. F

4. A single break statement will skip the current iteration of loops. T

5. The switch statement is the looping statement. F


D. Answer the following questions.
a. What are jump statements?

Sometimes, there is a situation when the control of the program needs to be


transferred out of the loop body, even if all the values of the iterations of the loop have
not been completed.

b. Write the syntax of the ‘for loop’.

The for statement executes a simple or compound statement for a fixed number of
times. The syntax of the statement is given below:

For <variable> in <iterator>:

statement

c. Demonstrate the use of the while loop using else statement.

The while statement executes a set of statements repeatedly, until the logical
expression evaluates to true.

E. Answer the following questions:


1. Write an if condition to display “Yes” or “No” if it is a weekend today or your office.
IF (TODAY IS WEEKEND)
THEN
DISPLAY “YES”
ELSE
DISPLAY “NO”
2. Write a program to check whether a given number is odd or even. If the number is
even, then print “Even number”. If the number is odd, then print “Odd number”.
IF (number%2==0)
THEN
PRINT “Even number”
ELSE
PRINT “Odd number”
F. Competency-based/Application-based question:
Your sister Vaishali wants to display “Yes” or “No” if the numbers from 1 to 50 is
divisible by 5, also include first and the last number in calculation.
for n in range (1,51):
If (n%5==0):
print (”Yes”)
else:
print(”No”)

You might also like