wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Sseamless Sseventy

Total questions: 70

Worksheet time: 35mins

Name
Class
Date
1.

What is syntax?

a)

the word used to describe an error

b)

the rules of the programming language

c)

used to read information

d)

used to output information

2.

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

print (people[-1])


what would the output be?

a)

John

b)

Rob

c)

Bob

3.

What syntax can you use to insert a line break between strings so that they appear over multiple lines?

a)

/

b)

\n

c)

\1

d)

n

4.

Joining elements together to make a string is called what?

a)

Combining

b)

Connecting

c)

Concatenation

d)

Stringing

5.

Tells the interpreter that the code which follows is a function

a)

const

b)

int

c)

def

d)

while

6.

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

print (people[1])


What would the output be?

a)

John

b)

Rob

c)

Bob

7.

What does the term 'debug' mean?

a)

Make a calculation

b)

Identify errors and fix them

c)

A set of instructions

d)

Looking at code

8.

Python is an example of a:

a)

text-based programming language

b)

object orientated programming language (OOP)

c)

language written in java script

d)

visual-based programming language

9.

What is the function to decide if a string only contains numbers?

a)

isalpha()

b)

isnumeric()

c)

int()

d)

string()

10.

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

a)

elif

b)

else

c)

ifif

11.

Python identifies blocks of code by BEGIN and END keywords and...

a)

guessing

b)

aligning up the starts of lines (indentation)

c)

capitals

12.

Code repeated or looped until a condition has been met is called:

a)

Sequence

b)

Selection

c)

Iteration

d)

Variable

13.

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

14.

What is python named after

a)

the python snake

b)

the Monty Python TV show

c)

the creator's pet

15.

Code executed based on a condition being true is called:

a)

Sequence

b)

Selection

c)

Iteration

d)

Variable

16.

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

17.

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!

18.

what does the following code do?

myAge = int(myAge)

a)

Converts the variable myAge to a string

b)

Converts the variable myAge to an integer

c)

Converts the variable myAge from an integer to a string

d)

Converts the variable myAge to a statement

19.

What is the output for:


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

print(people[4])

a)

John

b)

Rob

c)

Bob

d)

Error

20.

What is the output from the following:

print(Hello world!)

a)

Hello world!

b)

SyntaxError

c)

Hello world

d)

print(Hello world!)

21.

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)

22.

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!"


What will the output be if I am 18 years old!

a)

You are aged to perfection

b)

You are a spring chicken

c)

Wow, you are half a century old!

23.

What best defines an IF statement?

a)

It is an embedded string with a variable

b)

it checks to see if a statement is true or false and then does one of two things depending on the result

24.

If we needed to store a POSTCODE, what data type would we use?

a)

string (alphanumerical)

b)

float (decimal point)

c)

Boolean (true or false)

25.

The INTEGER data type can be defined as..

a)

holds whole numbers

b)

holds numbers with a decimal pint

c)

holds either 'true' or 'false'

26.

Pseudocode is:

a)

a notation resembling a complex programming language, used in program design.

b)

a notation resembling a simplified programming language, used in program design.

27.

What is the definition for a VARIABLE?

a)

a changeable value, such as a score in a computer game.

b)

a value that cannot be changed

28.

What is the code for a STRING?

a)

str

b)

stri

c)

stg

29.

the FLOAT data type is defined as:

a)

holds alphanumerical data

b)

holds whole numbers

c)

holds a decimal point in a number

d)

holds either true or false

30.

the BOOLEAN data type is defined as...

a)

holds alphanumerical data

b)

holds whole numbers

c)

holds a number with a decimal point

d)

holds either true or false

31.

the STRING data type is defined as...

a)

holds alphanumeric text

b)

holds whole numbers

c)

holds numbers with a decimal point

d)

holds either a true or false value

32.

What is the correct code for INTEGER?

a)

in

b)

ing

c)

int

33.

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!"


What will the output be if I am 77 years old!

a)

You are a spring chicken!

b)

You are aged to perfection

c)

Wow, you are half a century old

d)

You are very very old!

34.

What symbol surround multi-lined comments

a)

" " "

b)

**

c)

#

d)

%

35.

What symbol is used to create exponents (to the power of)

a)

**

b)

" " "

c)

%

d)

#

36.

What runs code line by line and checks for errors?

a)

interpreter

b)

variable

c)

modulo

d)

boolean

37.

What symbol is used for modulo (remainder after division)?

a)

%

b)

&

c)

#

d)

**

38.

the correct way to write a variable is..

a)

my_variable=10

b)

my variable = 10

c)

my_variable is 10

d)

my_variable: 10

39.

Changing the value of a variable is called:

a)

reassigning

b)

commenting

c)

modulo

d)

boolean

40.

102 = 100 is written in code as..

a)

10*2

b)

10%2

c)

10**2

d)

10**10

41.

A line of text that won't run in Python is called:

a)

variable

b)

modulo

c)

comment

d)

boolean

42.

What returns the remainder from a division?

a)

exponent

b)

boolean

c)

variable

d)

modulo

43.

This thing includes numbers and booleans:

a)

white space

b)

modulo

c)

data types

d)

comments

44.

What stores a piece of data and gives it a specific name

a)

white space

b)

interpreter

c)

modulo

d)

variable

45.

What name is a data type that can be only true or false:

a)

modulo

b)

boolean

c)

variable

d)

interpreter

46.

What is used to structure code in Python?

a)

comments

b)

booleans

c)

variables

d)

white space

47.

print("Hello world!"*2*"Hello world!")


What is the output?

a)

Hello world! Hello world! Hello world! Hello world!

b)

Hello Hello World! World!

c)

Hello world! Hello world!

d)

TypeError

48.

print("3+4")


What is the output?

a)

3+4

b)

7

c)

34

d)

SyntaxError

49.

print("Hello" + "world!")


what is the output?

a)

Helloworld!

b)

"Hello" "world!"

c)

Hello world!

d)

Hello+world!

50.

print(9/3*2+4-5)

a)

19

b)

5.0

c)

0.5

d)

5

51.

Which command is used to output information to the screen?

a)

read

b)

output

c)

print

d)

display

52.

print("Hello" + str(2) + "world!")

a)

Hello world! Hello world!

b)

Hello2world

c)

Hello Hello world! world!

d)

SyntaxError

53.

print(3*4)


What is the output?

a)

34

b)

7

c)

12

d)

3*4

54.

print("Hello" + "world" + "today")

a)

Hello world today

b)

"Hello" "world" "today"

c)

Helloworldtoday

d)

SnytaxError

55.

print("Hello" + 2 + "world")

a)

Hello2world

b)

Hello2world

c)

TypeError

d)

HelloHelloworld

56.

print("Hello world!\nHello world!")

a)

Hello world! Hello world!

b)

Hello world!

Hello world!

c)

SyntaxError

d)

Hello world!

57.

print(Hello world!)


What is the output?

a)

Hello world!

b)

SyntaxError

c)

Hello world

d)

print(Hello world!)

58.

print(9/3)

a)

3

b)

3.0

c)

9/3

d)

SyntaxError

59.

Which one of these would work as a piece of code?

a)

IF answer=="Yes"

b)

if answer=="Yes"

c)

if answer=="Yes":

d)

if answer="yes"

60.

To solve a problem that requires the user to enter 10 numbers would use what type of iteration?

a)

While loop

b)

For loop

c)

Variable

d)

Selection

61.

The second part of if (that is executed when the condition is false) is:

a)

if

b)

else

c)

for

d)

input

62.

The character that must be at the end of the line for if, while, for etc is:

a)

;

b)

.

c)

,

d)

:

63.

A data type consisting of numbers, letters and symbols is:

a)

Integer

b)

String

c)

Float

d)

Boolean

64.

What is code that is executed based on a condition being true called?

a)

Sequence

b)

Selection

c)

Iteration

d)

Variable

65.

What is the name for repeating until a particular condition is true called:

a)

for loop

b)

if loop

c)

while loop

d)

indentation

66.

In Python, blocks of code are identified by:

a)

BEGIN and END

b)

{and}

c)

aligning up the starts of lines

d)

guessing

67.

Converts a number to a string:

a)

int()

b)

parseInt()

c)

convert

d)

str()

68.

How do you correctly format a comment?

a)

!Comment

b)

&Comment

c)

""Comment""

d)

#Comment

69.

Which data type is for whole numbers?

a)

string

b)

Integer

c)

boolean

d)

float

70.

Which do you need for repeating until a particular condition is true:

a)

while loop

b)

for loop

c)

if loop

d)

indentation