wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Grade 8 Quiz

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.
What is the correct file extension for Python files?
a)
.py
b)
.pyt
c)
.pt
d)
.pyth
2.
What is the correct way to create a function in Python?
a)
def myFunction():
b)
function myfunction():
c)
create myFunction():
3.
In Python, 'Hello', is the same as "Hello"
a)
True
b)
False
4.
Which operator is used to multiply numbers?
a)
*
b)
#
c)
%
d)
x
5.
Which of these collections defines a LIST?
a)
["apple", "banana", "cherry"]
b)
{"name": "apple", "color": "green"}
c)
("apple", "banana", "cherry")
d)
{"apple", "banana", "cherry"}
6.
How do you start writing a while loop in Python?
a)
while x > y:
b)
x > y while {
c)
while (x > y)
d)
while x > y {
7.
Which statement is used to stop a loop?
a)
break
b)
exit
c)
stop
d)
return
8.
Which operator can be used to compare two values?
a)
==
b)
=
c)
><
d)
<>
9.
How do you insert COMMENTS in Python code?
a)
//This is a comment
b)
/*This is a comment*/
c)
#This is a comment
10.

What is a function mainly used for?

a)

Decorating sprites

b)

Storing values

c)

Reusing a set of instructions

d)

Playing sounds