wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Introduction to Python

Total questions: 20

Worksheet time: 7mins

Name
Class
Date
1.

Python is an example of a:

a)

Text-based programming language

b)

Visual-based programming language

c)

Block-based programming language

d)

Language written in JavaScript

2.

What will the output be from the following code? Print (“Hello world!”)

a)

SyntaxError

b)

“Hello world!”

c)

Hello world!

d)

Print (Hello world!)

3.

Which of the following is a correctly-formatted comment?

a)

&comment

b)

“”Comment””

c)

!comment

d)

#comment

4.

What does term ‘debug’ mean:

a)

looking at the code

b)

a set of instructions

c)

Identify errors and fix them

d)

Making a calculation

5.

The correct way to write a variable in python?

a)

my_variables=10

b)

my_variable:10

c)

my variable=10

d)

my_variable is 10

6.
What kind of programming language is Python?
a)
High Level  & Object Orientated
b)
Low Level & Object Orientated
c)
High Level & Procedural
d)
Low Level & Procedural
7.
How would you assign an integer to a variable?
a)
new_var = 4
b)
new_var == 4
c)
new_var = "4"
d)
new var "4"
8.
The variable new_var = 7.  To print the value of new_var, which statement would you use?
a)
output "new_var"
b)
print new_var
c)
print "new_var"
d)
output "7"
9.
Which symbol do we use if we want to add a comment to our code?
a)
@
b)
#
c)
*
d)
&
10.
What data type is a in this code : a = "5"
a)
integer
b)
float
c)
boolean
d)
string
11.
What does the statement 'print' do?
a)
Output a hard copy of a program to a printer
b)
Output a message on the screen
c)
Print a hard copy of a flowchart to a computer
12.
What is a variable?
a)
A number
b)
A message input by the user
c)
A location in memory that we use to store data
13.
Which of the following is correct?
a)
The Python interpreter ignores comments
b)
Comments are used by programmers for a better understanding of the program
c)
You use the # symbol before a comment
d)
All of the above
14.

Python (TM) is owned and managed by

a)

Microsoft (c)

b)

Sun Microsystems (c)

c)

Python (TM) is open source and free to use

d)

Google (c)

15.

Python is ___________ level programming language and is ___________.

a)

High, compiled

b)

High, interpreted

c)

Low, compiled

d)

Low, interpreted

16.

Generally speaking, a low level programming language is easier to read, write and maintain over a high level programming language

a)

True

b)

False

17.

The syntax in Python (TM) is one of the main advantages over other high level programming languages.

a)

True

b)

False

18.

A disadvantage of Python is it is harder to debug than other higher level programming languages.

a)

True

b)

False

19.

Since Python (TM) is open source,

a)

Support for using Python (TM) is easy to find

b)

It is free

c)

There is a large catalog of supporting documents

d)

it is a less powerful programming languange

20.

Generally speaking Python (TM) would run _____________ than C++ and take ____________ time to create

a)

faster, less

b)

faster, more

c)

slower, less

d)

slower, more