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

Python Notes

The document contains a grade 8 Python quiz covering topics such as sequences, loops, and list operations. It includes multiple-choice questions, true/false statements, fill-in-the-blanks, and short answer questions about loops and their syntax. Key concepts discussed include the use of 'for' and 'while' loops, the range function, and list manipulation methods.

Uploaded by

s19130
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)
7 views2 pages

Python Notes

The document contains a grade 8 Python quiz covering topics such as sequences, loops, and list operations. It includes multiple-choice questions, true/false statements, fill-in-the-blanks, and short answer questions about loops and their syntax. Key concepts discussed include the use of 'for' and 'while' loops, the range function, and list manipulation methods.

Uploaded by

s19130
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

GRADE 8

PYTHON
A. TICK [✔] THE CORRECT OPTION:

 __________ is a collection of elements, string, list, etc.


✅a. Sequence
 To use else with for loop, the structure is known as _________:
✅c. for else
 __________ statement can be used to unconditionally jump out of the loop.
✅a. Break
 ___________ refers to a process of accessing each item of a list one by one.
✅c. Indexing

B. WRITE 'T' FOR TRUE AND 'F' FOR FALSE STATEMENTS:

· The range() is a pre-defined function of Python. TRUE

· The continue statement skips the current iteration, not terminate the loop. FALSE

· By default, indexing in Python starts with zero (0). FALSE

· The append() function adds a new item to the end of the list. TRUE

C.FILL IN THE BLANKS:

· Loop causes a program to be repeated a certain number of times.

· The range function consists of start, stop, and step parameters.

· The colon (:) operator is used to create a slice in Python.

· Two or more lists can be joined using + operator.

D.ANSWER THE FOLLOWING:

1. What do you mean by loop?


A loop is a programming construct that repeats a block of code multiple times until a condition is
met.
2. Explain for loop.
A for loop is used to iterate over a sequence (like a list, string, or range).
Example:

for i in range(5):

print(i)

3. What is while loop? Write its syntax.


A while loop repeats a block of code as long as a given condition is True.

Syntax:

while condition:

# block of code

Example: i = 1

while i <= 5:
print(i)
i += 1

You might also like