wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Intro to Python

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

What is a variable?

a)

A math operator

b)

An element, feature, or factor that is liable to vary or change.

c)

An if statement

d)

A computer system that can change

2.

What does print("hello) display?

a)

hello

b)

gives you an error

c)

"hello"

d)

"hello

3.

What does \n do?

a)

Adds a quotation

b)

Creates a number

c)

Adds a new line

d)

Adds a fullstop

4.

What symbol would you use to add a comment to your code?

a)

//

b)

#

c)

-

d)

]]

5.

How do you ask an input from a user?

a)

name = int("what is your name")

b)

name = input(what is your name?)

c)

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

d)

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

6.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
7.

Finding and fixing the errors in a program

a)

Indentation

b)

Nesting

c)

Event Block

d)

Debugging

8.

A block of code that may repeat or run more than once.

a)

Loop

b)

If

c)

Function

d)

Event Block

9.
Which option best describes how user input can impact our programs?
a)
It forces the user to write their own program
b)
It allows us to make programs interactive
c)
It lets us grade the user on their work
d)
User-input has no impact on our programs
10.
A character that is controlled by a program through code is referred to as a 
a)
animal
b)
sprite
c)
person
d)
dojo
11.

____________ is information the user sends to the computer

a)

Software

b)

Input

c)

Secondary Memory

d)

Program

12.

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

13.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
14.
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
15.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
16.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

17.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
18.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
19.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
20.
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")