wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Coding Specialist Exam

Total questions: 53

Worksheet time: 26mins

Name
Class
Date
1.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

name

c)

"Dave"

d)

(name)

2.

What is a input?

a)

To plug in something

b)

A function that allows us to ask the user to enter some data

c)

Data displayed on a screen

d)

A routine

3.

A variable must have been assigned (given) a value before that value is referenced (used).

a)

True

b)

False

4.

The correct way to convert user input is:

a)

birth_year = number(input())

b)

birth_year = int(input())

c)

birth_year = (input(int))

d)

birth_year = int(input)

5.

To display the following on screen Hello World! the following command should be used:

a)

print(Hello World!)

b)

print("Hello World" + !)

c)

print("Hello World!")

d)

print"(Hello World!)"

6.

You assign a value to a variable with which symbol

a)

@

b)

==

c)

=

d)

*

7.

The code you use to receive and input from the keyboard

a)

enter()

b)

add()

c)

receive()

d)

input()

8.

Program statements are executed in sequence, one after the other...

a)

True

b)

False

9.

if you receive a NameError when you run your program it means....

a)

A variable has been assigned before it has been referred to

b)

An incorrect name has been chosen

c)

A variable has been referred to before it has been assigned

d)

A language key word has been used

10.

If the coding steps are in the incorrect order, the computer can still execute the program.

a)

True

b)

False

11.

Which has integer data type?

a)

Phone number

b)

Zip code

c)

HN

d)

Number of students in the class

12.
What is Python really?
a)
Python is an interpreted language.
b)
visual basic
c)
a snake 
d)
a form of font for writing 
13.
what are the advantages of python?
a)
free and open source 
b)
can do the work for you 
c)
easy 
14.
what is 8%2
a)
0
b)
16
c)
24
d)
86
15.
what is python?
a)
a programming language 
b)
a code 
c)
nothing 
d)
a game 
16.
Code executed based on a condition being true
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
17.

What does the following code do? myAge = int (myAge)

a)

Converts the var (variable) myAge to a string

b)

Converts the var (variable) myAge to a integer

c)

Converts the var (variable) myAge from a integer to a string

d)

Converts the var (variable) myAge to if statement

18.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
19.
Tells the interpreter that the code which follows is a function
a)
const
b)
int
c)
def
d)
while
20.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
21.
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
a)
/
b)
\n
c)
\l
d)
n
22.
What will the output be from the following code?
print("Hello world!" * 2)
a)
TypeError
b)
Hello world world!
c)
Hello world!Hello world!
d)
Hello world! * 2
23.
If you want more than one option for your code, what do you use (after if)?
a)
elif
b)
else
c)
ifif
24.

Python is ___________ level programming language and is ___________.

a)

High, compiled

b)

High, interpreted

c)

Low, compiled

d)

Low, interpreted

25.

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

a)

True

b)

False

26.

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

27.
Which python operator means 'less than or equal to'?
a)
>
b)
<
c)
>=
d)
<=
28.
What is another word for 'iteration'?
a)
Selection
b)
Variable Assignment
c)
Repetition
d)
Sequencing
29.
How many times will this loop run?
a)
10
b)
9
c)
4
d)
5
30.
I want to allow the program to repeatedly ask the user to enter their guess if it does not equal the answer...Which option do I use?
a)
while guess == answer:
    guess=input()
b)
while answer != guess:
guess=input()
c)
while answer =! guess:
guess=input()
d)
while guess != answer:
guess=input()
31.

Which word completes this sentence: "Iteration makes code more ___________"

a)

Complex

b)

Efficient

c)

Simple

d)

Straightforward

32.

A FOR loop is....

a)

A COUNT controlled loop

b)

A CONDITION controlled loop

33.

A WHILE loop is....

a)

A COUNT controlled loop

b)

A CONDITION controlled loop

34.

What will the output be for the code shown here?

a)

3,2,1,0

b)

0,1,2,3

c)

3,2,1

d)

1,2,3

35.

What would the output be for the code shown here?

a)

0,1,2,3,4,5,6,7,8,9

b)

1,2,3,4,5,6,7,8,9,10

c)

0,2,4,6,8,10

d)

0,2,4,6,8

36.

Anil is writing a "rock, scissors, paper" program. He wants the game to repeat until the user doesn't want to play anymore. What loop should he use?

a)

a FOR loop

b)

a WHILE loop

37.

Clara is writing a program that will print out the first ten numbers of a times table (chosen by the user). Should she use....

a)

a FOR loop

b)

a WHILE loop

38.

Tara has written a "Hide and Seek Simulator" - what will happen when she runs it?

a)

It will print "1,2,3,4,5,6,7,8,9,10 Coming ready or not!"

b)

The program will not run

c)

It will print "1,2,3,4,5,6,7,8,9,11 Coming ready or not!"

d)

It will print ("10 Coming ready or not!")

39.

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

40.

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)

41.

Python is ___________ level programming language and is ___________.

a)

High, compiled

b)

High, interpreted

c)

Low, compiled

d)

Low, interpreted

42.

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

a)

True

b)

False

43.

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

a)

True

b)

False

44.

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

45.

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

46.

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

47.

What symbol comes before a comment?

a)

$

b)

>>

c)

#

d)

!

48.

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

49.

Debugging is

a)

how characters are arranged in a statement

b)

detecting or removing errors from a program

c)

removing viruses from a computer

d)

the meaning of each of the characters and symbols in the program

50.

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

a)

True

b)

False

51.

In programming, a (n) _______________ is a value that can change, depending on conditions or on information passed to the program

a)

string

b)

block

c)

instruction

d)

variable

52.

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

53.

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