Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Clevered - Python-Halloweeen

Total questions: 25

Worksheet time: 25mins

Name
Class
Date
1.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
2.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
3.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
4.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
5.
Data type that can only be true or false
a)
int
b)
string
c)
bool
d)
float
6.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
7.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
8.

Which of these is a string?

a)

42

b)

True

c)

"This one!"

d)

No, this one

9.

The code snippet above outputs

a)

error

b)

None

c)

NaN

d)

-1

10.

What is the output of the code above

a)

None

b)

Syntax Error

c)

-1

d)

Code doesn't compile

11.

The code above prints

a)

Math

Physics

Chemistry

English

b)

4

3.8

3.6

3.7

c)

None

None

None

None

d)

NaN

NaN

NaN

NaN

12.

The output of the code above is

a)

[101, 102, 103, 104]

b)

[3.6, 3.7, 3.8, 4]

13.

The program above

a)

prints all the odd numbers between 1 and 20

b)

prints all even numbers between 1 and 20

c)

print all the odd numbers between 1 and 21

d)

prints all the even numbers between 1 and 21

14.

The equivalent of the above for loop using the while syntax would be

a)
b)
c)
d)
15.

How many times will 1 be printed

a)

3

b)

4

c)

5

d)

6

16.

What is the output of the given code?

a)

10 20 10

b)

10

c)

20

d)

10 20

17.

What is the output of the given code?

a)

10 20 10 20

b)

10 20 10

c)

10 20 20

d)

Error

18.

The default return value of any function in Python is _______________.

a)

null

b)

0

c)

None

d)

Garbage value

19.

Result of the program above is

a)

('1', '2', '3', '4', '5')

b)

(1, 2, 3, 4, 5)

c)

12345

d)

"12345"

20.

What is the output of the code above

a)

(1, '2', 3, 4, 5)

b)

syntax error

c)

(1, 2, 3, 4, 5)

d)

('1', '2', '3', '4', '5')

21.

Examples of String Literals

a)

"ABC1273"

b)

nfjdlsj@@$

c)

12638

d)

'7e920938'

22.

Which Halloween activity is this?

a)

Treat or Trick

b)

Trick or Treat

c)

Trick or Candy

d)

Give me candy

23.

Who's this?

a)

Frankenstein

b)

Shrek

c)

Green monster

d)

Grinch

24.

What's this?

a)

Crazy house

b)

Haunted house

c)

House of dark

d)

Ghost house

25.
Most of the candy purchased for Halloween is: 
a)
gummy candy
b)
hard candy
c)
chocolate
d)
bubble gum