wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PP-ASSESSMENT-1

Total questions: 20

Worksheet time: 16mins

Name
Class
Date
1.

Which of these is the correct code for creating a list of names?

a)

nameList = John, Harry, Jesse, John, Harry, Harry

b)

nameList = ("John", "Harry", "Jesse", "John", "Harry", "Harry")

c)

nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]

d)

nameList = [John, Harry, Jesse, John, Harry, Harry]

2.

The list needs one more name added to the end - "Felipe". Which piece of code below would do this?

nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]

a)

nameList.append(Felipe)

b)

append(nameList,"Felipe")

c)

nameList.append["Felipe",7]

d)

nameList.append("Felipe")

3.
Python identifies blocks of code by
a)
BEGIN and END keywords
b)
{ and }
c)
aligning up the starts of lines (indentation)
d)
guessing
4.

Which kind of loop would be used?


I need a program that will keep letting me add money to a piggy bank until I get to £100.

a)

FOR Loop

b)

WHILE Loop

5.

Find the Output:

Item = {"ECE" , "CSE" , "EEE" , "CIVIL"}

Item.add (2,"MECH")

print(Item)

a)

{ "ECE" , "MECH" , "CSE" , "EEE" , "CIVIL" }

b)

{ "ECE" , "CSE" , "MECH" , "EEE" , "CIVIL" }

c)

{ "ECE" , "CSE" , "EEE" , "CIVIL" }

d)

{ "ECE" , "CSE" , "EEE" ,"MECH" , "CIVIL" }

6.
In Python an ELSE IF statement is represented as what?
a)
elseif
b)
elif
c)
elsif
d)
ifelse
7.
a)
3, 1, 6, 7, 2, 4, 5
b)
6, 3, 1, 2, 4, 5, 7
c)
3, 6, 1, 2, 4, 5, 7
d)
3, 6, 2, 5, 1, 4, 7
8.
What will the output be from the following code?
print("Hello" + str(2) + "world!")
a)
Hello world! Hello world!
b)
Hello2world!
c)
Hello Hello world! world!
d)
SyntaxError
9.
What will the output be from the following code?
print(9/3*2+4-5)
a)
19
b)
5.0
c)
0.5
d)
5
10.

Look at this code, which of these is a variable?

a)

input

b)

4

c)

int

d)

mylength

11.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
12.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
13.
What letter will be printed on the screen after running this code:
a)
e
b)
x
c)
t
d)
Nothing prints
14.
What output will this code produce?
a)
3
b)
20
c)
25
d)
17
15.

What will the output be from the following code?

print(3+4)

a)

3+4

b)

7

c)

SyntaxError

d)

print(3+4)

16.
print("12"*3)
What would this print?
a)
36
b)
121212
c)
24
d)
12*3
17.

What will the output be from the following Python code?

print(9/3)

a)

3

b)

3.0

c)

9/3

d)

SyntaxError

18.

Which of these is correct Python conditional statement?

a)

IF answer == "Yes":

b)

if answer == "Yes"

c)

if answer == "Yes":

d)

if answer = "yes":

19.

What will this code do?

a)

Print Numbers 1-11

b)

Print Numbers 1-10

c)

Print Numbers 2-10

d)

Print Error

20.

What will be the output of this code?

a)

0,2,4,6,8

b)

0,2,4,6,8,10

c)

2,4,6,8,10,12

d)

0,2,4,6,8,10,12