wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Introduction to python

Total questions: 32

Worksheet time: 18mins

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.

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

4.

Which of the following is a correctly-formatted comment?

a)

&comment

b)

“”Comment””

c)

!comment

d)

#comment

5.

A data type consisting of numbers letters and symbols:

a)

String

b)

Integer

c)

Float

d)

Boolean

6.

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

7.

To repeat until a particular condition is true use:

a)

While loop

b)

For loop

c)

If loop

d)

Indentation

8.

What does Python turtle allow you to do?

a)

Draw using Java

b)

Draw using python

c)

Insert Audio

d)

Edit photo

9.

If you want more than one option for your code, what do you use (after if)?

a)

If if

b)

Else

c)

And

d)

Elif

10.

What does an if statement do?

a)

Close the program

b)

Ask a question

c)

Make a decision

d)

Write a comment

11.
Which data type is used to store:
100
a)
Integer
b)
Double
c)
Boolean
d)
String
12.
Which data type is used to store:
TRUE
a)
Boolean
b)
Double
c)
String
d)
Integer
13.
Which data type is used to store:
"D"
a)
Character
b)
String
c)
Integer
d)
Double
14.
This data type is used to store whole numbers
a)
Integer
b)
Double
c)
Boolean
d)
String
15.
This data type is used to store a mixture of letters and numbers and symbols.
a)
String
b)
Character
c)
Boolean
d)
Integer
16.

What is a variable?

a)

A storage location of memory which can change

b)

A random area to store things in.

c)

Something that changes

d)

Something that can only store numbers

17.

What is a Constant?

a)

A storage location of memory which does not change

b)

A random area to store things in.

c)

Something that changes

d)

Something that can only store numbers

18.

Which variable uses a integer data type?

a)

password

b)

passwordScore

c)

passwordLength

19.

Which variable uses a string data type?

a)

password

b)

passwordScore

c)

passwordLength

20.

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

21.

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)

22.

Why was Python (TM) developed?

a)

To go back to the old way of programming

b)

To create a programming language for students in grade school

c)

To make it easier to learn Java

d)

Python was developed by accident

23.

Python is ___________ level programming language and is ___________.

a)

High, compiled

b)

High, interpreted

c)

Low, compiled

d)

Low, interpreted

24.

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

a)

True

b)

False

25.

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

a)

True

b)

False

26.

A statement in programming

a)

Expresses an action to be carried out

b)

Always returns results like expressions

c)

Rules controlling how components in a program are combined

d)

An instruction to perform a task, usually one word

27.

A string

a)

carries out an action

b)

the elements of a command

c)

a collection of characters

d)

how elements in a commad are arranged

28.

A block is

a)

a statement including elements of a command

b)

the structure and form of the code

c)

source code that is grouped together

d)

meaning assigned to symbols, characters and words

29.

What symbol comes before a comment?

a)

$

b)

>>

c)

#

d)

!

30.

An exception is

a)

the structure of form of the code

b)

the meaning of the characters and words in the code

c)

the statement that is missing from the instructions

d)

an event occurring during execution of a program which disrupts the flow of the program's instructions

31.

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

32.

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