wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Intro to Python class open book quiz.

Total questions: 45

Worksheet time: 26mins

Name
Class
Date
1.
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
2.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
3.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

4.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
5.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
6.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
7.
Which statement correctly assigns the string "Tanner" to the variable name?
a)
name  = print( "Tanner")
b)
input("Tanner")
c)
name = "Tanner"
d)
name = input("Tanner")
8.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)

It displays an output

d)
It loops the code.
9.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
10.

Spelling is not important in Python (it will know what you meant to type)

a)

True

b)

False

11.

What does IDE stand for?

a)

Integrated Development Environment

b)

Internet Development Editor

c)

Internet Development Environment

d)

Icelandic Development Editor

12.

What does \n do?

a)

Adds a quotation

b)

Creates a number

c)

Adds a new line

d)

Adds a fullstop

13.

How will the following code look on the screen?

print ("I love programming.")

print ("I love programming.")

a)

"I love programming."

"I love programming."

b)

I love programming.

I love programming.

c)

I love programming. I love programming.

d)

I LOVE PROGRAMMING

I LOVE PROGRAMMING

14.

The statement IF and ELSE allows us to:

a)

quit

b)

print

c)

delete

d)

compare

15.

The == operator is a:

a)

function operator

b)

comparison operator

c)

the opposite operator

d)

code operator

16.

A store your program must use as an identifier to keep track of a value is called a

a)

Algorithm

b)

Variable

c)

Program

d)

Assignment

17.

An  algorithm  is a set of precise instructions designed to solve a problem.

a)

True

b)

False

18.

Which symbol assigns a value to a variable?

(a)  

19.

Which of the following would be an example of a string variable:

a)

ValidInput = False

b)

GuessCount = 100

c)

Name = "Bilbo"

d)

Pi = 3.14159265359

20.

Which of the following would be an example of a float variable:

a)

ValidInput = False

b)

GuessCount = 100

c)

Name = "Bilbo"

d)

Pi = 3.14159265359

21.

What would be the result of 9 // 7

(a)  

22.

What would be the reult of 9 % 7

(a)  

23.

What would print (10 + 16) produce?

a)

10

b)

16

c)

24

d)

26

24.

name=input("What is your name? ")

print("Your name is " + name)

What will be displayed if the user types in "Bob"?

a)

Your name is name

b)

name

c)

Bob

d)

Your name is Bob

25.

What, if anything, is wrong with the following?

input("Type your password: ")

a)

There is no variable

b)

Input commands don't need ( )

c)

Input commands don't need " "

d)

Nothing is wrong

26.

What, if anything, is wrong with the following?

input=x("Type your password: ")

print(x)

a)

The variable should be switched with the input command

b)

Input commands don't need ( )

c)

You can't print x

d)

Nothing is wrong

27.

What, if anything, is wrong with the following?

x=input("Type your password: ")

print("You typed", x)

a)

The variable should be switched with the input command

b)

You can't use commas in print statements

c)

You can't print x

d)

Nothing is wrong

28.

What, if anything, is wrong with the following?

x=input("Type your password: ")

print("You typed " + x)

a)

The variable should be switched with the input command

b)

You can't use + in print statements

c)

You can't print x

d)

Nothing is wrong

29.
Which of the following symbols is used in Python to mean "Equal to"?
a)
=
b)
!=
c)
==
d)
>=
30.
Which of the following symbols is used in Python to mean "Not equal to"?
a)
==
b)
!=
c)
<>
d)
><
31.
Which of the following symbols is used in Python to mean "Greater than or equal to"?
a)
<=
b)
>>
c)
>=
d)
=>
32.
Which of the following symbols is used in Python to mean "Less than or equal to"?
a)
<<
b)
=<
c)
<=
d)
!=
33.

Is this sequence, selection, or repetition?

a)

Sequence

b)

Selection

c)

Repetition

34.

Which statements do we use for selection?

a)

if statements

b)

loops

c)

sequential commands

35.

Which of the following character is used to give single-line comments in Python?

a)

//

b)

#

c)

<!-- -->

d)

$

36.

The result of this program:

Friday = False

if Friday:

print "Jeans day!"

else:

print "Uniform day"

a)

Jeans day

b)

Today is Friday

c)

Uniform day

d)

Not Friday

37.

What is the output?

a)

more than 7

b)

more than 23

c)

spam

d)

7

38.

What is the output?

a)

250.0

b)

200.0

c)

300.0

d)

350.0

39.

If else statement

a)

Outputs a message on the screen

b)

Gets data from the user

c)

A decision

d)

A loop controlled by a decision

40.

What will be outputted?

a)

number is bigger than 10

b)

nothing

c)

an error

d)

NUMBER IS BIGGER THAN 10

41.

Which is NOT a data type in Python?

a)

integer

b)

boolean

c)

anchor

d)

float

42.

Which is correct?

a)

A

b)

B

43.

What is the name of the variable in this program?

a)

print

b)

colour

c)

input

d)

" "

44.

print( (a)   ("What is your favourite colour?")

45.

What is the correct term for this symbol?


" "

a)

Quotation marks

b)

Bunny fingers

c)

Parenthesis

d)

Exclamation mark