Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Lesson 1

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

Variables are containers for storing data values

a)

True

b)

False

2.

Which of these is NOT a loop in python?

a)

for loop

b)

while loop

c)

None of the above

d)

if loop

3.

What is a variable?

a)

A box(memory location) where you store values

b)

a type of graphics

c)

Data type

d)

a type of memory

4.

Which of these is the best description of a list in Python?

a)

A list is a collection of data that has an order and can be changed

b)

A list is a lot of variables

c)

A list is used for shopping

d)

A list is a collection of data that cannot hold duplicated data and cannot be changed

5.

Will "something is printed" be printed to the console?

a)

Yes 👍

b)

No 👎

6.

Will "something is printed" be printed to the console?

a)

Yes 👍

b)

No 👎

7.

Will "something is printed" be printed to the console?

a)

Yes 👍

b)

No 👎

8.

What is the output of the following program?

a)

1

b)

2

c)

3

d)

4

e)

5

9.

Given the following list:

myList = [1,2,3,4,5,6]

which of these slices will return [1, 3, 5]?

a)

myList[1::2]

b)

myList[::2]

c)

myList[-2::-2]

d)

myList[:5:2]

e)

myList[:6:2]

10.

How many times will "hello" be printed to the console?

a)

1

b)

2

c)

3

d)

4

e)

5