wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AI

Total questions: 90

Worksheet time: 50mins

Name
Class
Date
1.

What is a folder?

a)

the name given to a set of recorded information

b)

the name given to the place where files that can be bought

c)

the name given to the place where files that can be stolen

d)

the name given to the place where files that can be stored

2.

Which of the following types of computer languages uses binary code to communicate with the computer?

a)

High-level languages

b)

Assembly languages

c)

Machine language

d)

Database languages

3.
What is the process of developing and implementing various sets of instructions to enable a computer to do a certain task?
a)
Computer Engineering
b)
Computer Programming
c)
Computer Processing
d)
Computer Science
4.
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
5.
What is python?
a)
a programming language 
b)
DTP software 
c)
Spreadsheet software
d)
Computer 
6.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
7.

What are the names of the two types of mode that are used in Python? Select two.

a)

Interactive mode

b)

Scratch mode

c)

Imperial mode

d)

Script mode

8.

What is the name of this symbol (>>>)?

a)

Chevrons

b)

Hash tags

c)

Colon

d)

Semi Colon

9.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
10.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
11.
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
12.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)
It displays something like a string or integer
d)
It loops the code.
13.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
14.
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
15.

Python is _____ sensitive which means you must use the same indentation every time.

a)

space

b)

colour

c)

code

d)

word

16.
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
17.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
18.
What is the correct definition for a VARIABLE?
a)
a changeable value, such as a score in a computer game.
b)
a value that cannot be changed
19.

A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly.

a)

True

b)

False

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")
21.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
22.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

23.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
24.
To create a newline at the end of prompt, you can use which of the following expressions?
a)
\new
b)
\n
c)
\break
d)
\return
25.
The number or word we give to a variable
a)
Value
b)
Bug
c)
Information
d)
Text
26.
What will be the output?
name = 'Dave'
greeting = "Good morning" + name
print (greeting)
a)
Good moning 'Dave'
b)
Good morning Dave
c)
Good morning name
d)
Good morning + Dave
27.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
28.

Is python an interpreter or compiler programming language?

a)

Compiler

b)

Interpreter

29.

Python is uses braces to block off code

a)

True

b)

False

30.

Python uses indentation to block code into chunks

a)

True

b)

False

31.

Python correct naming convention for constants is?

a)

firstName

b)

First_Name

c)

FIRST_NAME

d)

firstname

32.

Python correct naming convention for variables is?

a)

new_user25

b)

NewUser25

c)

25_new_user

d)

25NewUser

e)

NEWUSER25

33.

What output will the console show, if 15 and 30 are entered by the user?

a)

Syntax error

b)

The sum of the two numbers - 45

c)

The concatenation of the two numbers - 1530

d)

Complier error

34.

What datatype will the answer be if the user enters 15 and 30?

a)

Integer

b)

String

c)

Boolean

d)

Float

35.

Which one will display when this code is run?

a)
b)
c)
d)
36.
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!
37.
What will the output be from the following code?
print("Hello" + str(2) + "world!")
a)
Hello world! Hello world!
b)
Hello2world!
c)
Hello Hello world! world!
d)
SyntaxError
38.
Code executed based on a condition being true
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
39.
Code repeated / looped until a condition has been met or a set number of times.
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
40.

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

41.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
42.
Decides if a string only contains numbers
a)
isalpha()
b)
isnumeric()
c)
int()
d)
string()
43.
Tells the interpreter that the code which follows is a function
a)
const
b)
int
c)
def
d)
while
44.
Python identifies blocks of code by
a)
BEGIN and END keywords
b)
{ and }
c)
aligning up the starts of lines (indentation)
d)
guessing
45.
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
46.
If you want more than one option for your code, what do you use (after if)?
a)
elif
b)
else
c)
ifif
47.

people = ["John", "Rob", "Bob"]

print (people[1])

what would this result be?

a)
John
b)
Rob
c)
Bob
48.

people = ["John", "Rob", "Bob"]

print (people[-1])

what would this result be?

a)
John
b)
Rob
c)
Bob
49.

people = ["John", "Rob", "Bob"]

print (people[4])

what would this result be?

a)
John
b)
Rob
c)
Bob
d)
Error
50.
The number or word we give to a variable
a)
Value
b)
Bug
c)
Information
d)
Text
51.

If you want to create an empty list called colours in Python, which of the following is correct?

a)

colours = [ ]

b)

colours = ( )

c)

colours = { }

d)

colours = <>

52.
What letter will be printed on the screen after running this code:
a)
e
b)
x
c)
t
d)
Nothing prints
53.
What letter will be printed on the screen after running this code:
a)
e
b)
x
c)
t
d)
Nothing prints
54.
What is the position of the name "Robert" in the following list:
a)
0
b)
1
c)
2
d)
3
55.
What does the APPEND procedure do in the following code:
a)
Adds Liverpool to the beginning of the list
b)
Replaces Bristol with Liverpool
c)
Replaces Manchester with Liverpool
d)
Adds Liverpool to the end of the list
56.

Each item in a list has an index. What is the first index in a Python list?

a)

0

b)

1

c)

a

d)

A

57.
What output will this code produce?
a)
4
b)
2
c)
3
d)
5
58.
What output will this code produce?
a)
3
b)
20
c)
25
d)
17
59.
What output will this code produce?
a)
1
b)
3
c)
2
d)
4
60.

What will the output be from the following code?

print(3+4)

a)

3+4

b)

7

c)

SyntaxError

d)

print(3+4)

61.

What will the output be from the following Python code?

Print("Hello world!")

a)

NameError

b)

Hello world!

c)

"Hello world"

d)

Print(Hello world!)

62.

What will the output be from the following Python code?

print(9/3)

a)

3

b)

3.0

c)

9/3

d)

SyntaxError

63.

What is the Python built-in function to converts a number to a string?

a)

str()

b)

int()

c)

parseInt()

d)

convert

64.
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
65.

Which of these is correct Python conditional statement?

a)

IF answer == "Yes":

b)

if answer == "Yes"

c)

if answer == "Yes":

d)

if answer = "yes":

66.
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
67.
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’
68.
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
69.
In python the ' BOOLEAN data type' can be defined as...?
a)
holds alphanumerical data
b)
holds whole numbers
c)
holds a number with a decimal point
d)
holds either true or false
70.
What data type would be used for storing someone's telephone numbers?
a)
Float (using a decimal point)
b)
Integer (just whole numbers)
c)
String (alphanumerical data)
71.
If we needed to store information such as a POSTCODE in PYTHON, what data type would we use?
a)
String (alphanumerical)
b)
Float (decimal point)
c)
Boolean (true or false)
72.
What is the correct definition for 'pseudo code?'
a)
a notation resembling a complex programming language, used in program design.
b)
a notation resembling a simplified programming language, used in program design.
73.
What is the function of the code:amount = int(input("Enter a conversion into pounds:))currency = input ("press 1 for indian rupees, 2 for Chinese yuan or 0 to exit:")
a)
to find the total amount of currency altogether
b)
to calculate and convert the exchange rates.
74.
what is the code for a STRING in python?
a)
str
b)
stri
c)
stg
75.
What best defines an IF statement in python?
a)
Is an embedded string with a variable
b)
An IF statement checks to see if a statement is true or false and then does one of two things depending on the result.
76.
I am 71 years old! What will the output be?: IF you are 70 or older, say “You are aged to perfection!” ELIF you are exactly 50, say “Wow, you are half a century old!” ELSE say “You are a spring chicken!”
a)
“You are aged to perfection!”
b)
"Wow, you are half a century old!"
c)
"You are a spring chicken!"
77.
I am 18 years old! What will the output be?: IF you are 70 or older, say “You are aged to perfection!” ELIF you are exactly 50, say “Wow, you are half a century old!” ELSE say “You are a spring chicken!”
a)
"You are aged to perfection"
b)
"Wow, you are half a century old!"
c)
"You are spring chicken!"
78.
To repeat a fixed number of times use a
a)
while loop
b)
for loop
c)
if loop
d)
indentation
79.
The second part of if, that is executed when the condition is false
a)
if
b)
else
c)
for
d)
input
80.
The second part of if, that is executed when the condition is false
a)
if
b)
else
c)
for
d)
input
81.
The character that must be at the end of the line for if, while, for etc.
a)
:
b)
;
c)
.
d)
,
82.
Converts a number to a string
a)
str()
b)
int()
c)
parseInt()
d)
convert
83.
Python identifies blocks of code by
a)
BEGIN and END keywords
b)
{ and }
c)
aligning up the starts of lines (indentation)
d)
guessing
84.
Which of the following is a correctly-formatted comment?
a)
#Comment
b)
&Comment
c)
""Comment""
d)
!Comment
85.
a line of text that Python won't try to run as code
a)
comment
b)
modulo
c)
variable
d)
boolean
86.
To repeat until a particular condition is true use
a)
while loop
b)
for loop
c)
if loop
d)
indentation
87.
To repeat until a particular condition is true use
a)
while loop
b)
for loop
c)
if loop
d)
indentation
88.
a data type than can have one of two values: True or False
a)
boolean
b)
variable
c)
modulo
d)
interpreter
89.
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
90.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean