wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PYTHON print,input,turtle test

Total questions: 76

Worksheet time: 38mins

Name
Class
Date
1.
a)

Kite

b)

Triangle

c)

Square

d)

Rectangle

2.

The number of lines drawn in each case, assuming that the turtle module has been

a)

10,9

b)

9,10

c)

9,9

d)

10,10

3.
a)

Rectangle

b)

Trapezium

c)

Triangle

d)

Square

4.
a)

Error

b)

1 square

c)

2 squares, at a separation of 100 units, joined by a straight line

d)

2 squares, at a separation of 100 units, without a line joining them

5.
a)

a) Trapezium

b)

Parallelepiped

c)

Tetrahedron

d)

Star

6.

What is a programming language?

a)

Written English

b)

An artificial language used to program a computer

c)

A language used in pseudocode

d)

Machine code

7.

What does the print command do?

a)

Outputs a hard copy of a program to a printer

b)

Outputs a message on screen

c)

Print a hard copy of a flow chart to a printer

d)

Prints out the the commands line by line on the screen

8.

How do we get user input from the keyboard?

a)

input = (What is your name?)

b)

input = What is your name?

c)

output = ("What is your name?")

d)

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

9.
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
10.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

11.

What is the term for an error that a programmer makes in their code so the program won't run?

a)

Program error

b)

Syntax error

c)

Code error

d)

Logic error

12.
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")
13.

Which of the following variable names is NOT allowed to be used?

a)

first_name

b)

name1

c)

name#1

d)

lastName

14.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
15.
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
16.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
17.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
18.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
19.

Where's the error here?

a)

Bracket

b)

Input type

c)

Comma

d)

Variable

20.

A user inputs 6. What will be the error?

a)

Variable is wrong

b)

Input type is wrong

c)

Brackets are wrong

21.

Where's the error here?

a)

Variable

b)

Bracket

c)

Syntax/word is missing

d)

Wrong input

22.

Where's the error here?

a)

Bracket

b)

Variable

c)

Input type

d)

Missing syntax/word

23.

What would be the answer here

a)

14.56

b)

There would be an error

c)

8.56

24.

A user inputs 2, then 5. What would be the output here?

a)

55

b)

10

c)

There would be an error

25.

A user enter 5, then 7. What would be the output here?

a)

35

b)

77

c)

55

d)

There would be an error

26.

A user enter a 5, then 7. What would be the output?

a)

75

b)

57

c)

35

d)

There would be an error

27.

Print statement

a)

Outputs a message on the screen

b)

Gets data from the user

c)

A decision

d)

A loop controlled by a decision

28.

Input statement

a)

Outputs a message on the screen

b)

Gets data from the user

c)

A decision

d)

A loop controlled by a decision

29.

While statement

a)

Outputs a message on the screen

b)

Gets data from the user

c)

A decision

d)

A loop controlled by a decision

30.
What will the output be from the following code?
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
31.
To repeat a fixed number of times use a
a)
while loop
b)
for loop
c)
if loop
d)
indentation
32.
Which of the following is a correctly-formatted comment?
a)
#Comment
b)
&Comment
c)
""Comment""
d)
!Comment
33.
stores a piece of data, and gives it a specific name
a)
variable
b)
whitespace
c)
interpreter
d)
modulo
34.
a line of text that Python won't try to run as code
a)
comment
b)
modulo
c)
variable
d)
boolean
35.
To repeat until a particular condition is true use
a)
while loop
b)
for loop
c)
if loop
d)
indentation
36.
a data type than can have one of two values: True or False
a)
boolean
b)
variable
c)
modulo
d)
interpreter
37.
The correct way to write a variable in Python?
a)
my_variable = 10
b)
my variable = 10
c)
my_variable is 10
d)
my_variable: 10
38.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
39.
What is python named after
a)
The snake
b)
Television show called Monty Python
40.
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 
41.
What will the output be from the following code?
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!
42.
Python is an example of a....
a)
Text-based programming language
b)
Object orientated programming language
c)
language written in java script
d)
Visual-based programming language
43.

Which statement prints I am 10 years old?

a)

pint("I am 10 years old.")

b)

print('I am 10 years old.)

c)

print('')I am 10 years old.

d)

print("I am 10 years old.")

44.

What is the Python built-in function used to display numbers and text on the screen?

a)

print

b)

input

c)

output

d)

command

45.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
46.
What button do you press to compile (run) your program so that it runs in the shell?
a)
F3
b)
F5
c)
F7
d)
F9
47.

Which is the Python logo?

a)
b)
c)
d)
48.

What is a input?

a)

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

b)

To plug in something.

c)

Data displayed on a screen.

d)

A function

49.

x = 5

y = 6

print(x*y)


The code above displays the following:

a)

11

b)

x*y

c)

Syntax Error

d)

30

50.

Operators used in python:


divide, multiply, add, subtract

a)

/, *, +, -

b)

div, mul, +, -

c)

\, x, +, -

d)

~, *, +, -

51.
In programming, what is iteration?
a)
The repetition of steps within a program
b)
The order in which instructions are carried out
c)
A decision point in a program
d)
Testing a program to make sure it works
52.
Which type of loop iterates until instructed otherwise?
a)
FOR loop
b)
A count-controlled loop
c)
Repeat-once loop
d)
WHILE loop
53.
The condition for a while loop to continue could include which of the following?
a)
While something equals something
b)
While something is greater than something
c)
While something is True
d)
All of these
54.
Which of the following symbols is used in Python to mean "Greater than or equal to"?
a)
<=
b)
>>
c)
>=
d)
=>
55.
Which of the following symbols is used in Python to mean "Not equal to"?
a)
==
b)
!=
c)
<>
d)
><
56.
Which of the following symbols is used in Python to mean "Equal to"?
a)
=
b)
!=
c)
==
d)
>=
57.
a)
5
4
3
2
1
b)
4
3
2
1
0
c)
5  4  3  2  1
d)
4  3  2  1  0
58.
a)
5
4
3
2
1
b)
4
3
2
1
0
c)
5  4  3  2  1
d)
4  3  2  1  0
59.
a)
5
4
3
2
1
b)
5  4  3  2  1
c)
4
3
2
1
0
d)
4  3  2  1  0
60.
a)
10  8  6  4  2
b)
10
8
6
4
2
c)
2  4  6  8  10
d)
10  9  8  7  6  5  4  3  2  1
61.
a)
12  9  6  3  0
b)
0  3  6  9  12
c)
9  6  3  0
d)
0  3  6  9
62.
a)
Hello world!
b)
Hello world
c)
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
......(repeated continuously)
d)
Error
63.
Which of the following symbols is used in Python to mean "Less than or equal to"?
a)
<<
b)
=<
c)
<=
d)
!=
64.
a)
Hello world!
b)
Error
c)
Hello world!
False
d)
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
(repeated continuously)
65.

In Python, print () by default adds which of the following as an end line argument?

a)

\t

b)

\n

c)

\s

d)

\r

66.

What does IDE stand for?

a)

Internet Data Evaluation

b)

Integrated Drive Electronics

c)

Integrated Development Enterprises

d)

Integrated Development Environment

67.

Identify which of the following is not a valid variable name?

a)

X005 =10

b)

A.2 = 10

c)

N_s = 10

d)

r10 = 10

68.

How many operands are there in the following arithmetic expression?

6 * 35 + 8 – (25 / 5)

a)

4

b)

3

c)

5

d)

8

69.

Which of the following command is used to print the output 01-Jan-2020 ?

a)

print('01','Jan', sep=' ', end='-2020')

b)

print('01','Jan', sep='-', end='-2020')

c)

print('01','Jan', sep='-', end='2020')

d)

print('01','Jan','2020', sep='-', end='-2020\n')

70.

What is the correct file extension for Python files?

a)

.pyt

b)

.pyth

c)

.pt

d)

.py

71.

How do you insert COMMENTS in Python code?

a)

/*This is a comment*/

b)

#This is a comment

c)

//This is a comment

d)

Any of the Above

72.

The activity or job of writing computer programs.

a)

Syntax

b)

Programming

c)

Compiler

73.
In python the ' INTEGER data type' can be defined as...?
a)
holds alphanumeric data as text
b)
holds whole numbers
c)
holds numbers with a decimal point
d)
holds either ‘true’ or ‘false’
74.
In python the ' FLOAT data type' can be defined as...?
a)
holds alphanumerical data
b)

holds whole numbers

c)

holds a decimal point in a number

d)
hold either true or false
75.
In python the ' STRING data type' can be defined as...?
a)
holds alphanumeric text
b)
hold whole numbers
c)
holds numbers with a decimal point
d)
holds either a true or false value
76.
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