wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AMSI Python Quiz

Total questions: 21

Worksheet time: 11mins

Name
Class
Date
1.

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

2.

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? ")

3.

Which data type would you use for the quantity of stock in a shop?

a)

integer

b)

float

c)

string

d)

boolean

4.
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
5.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

6.

Which of the following input commands would allow the user to receive and store a string from the keyboard?

a)

string = input("Please enter a string:")

b)

string = int(input("Please enter a string:"))

c)

string = float(input("Please enter a string:"))

d)

string = bool(input("Please enter a string:"))

7.

What is type casting?

a)

It allows a piece of data to have it's data type changed, e.g. an integer could be changed to a string.

b)

It allows the program to display the value of a variable on the screen.

c)

It allows the program to collect data from the keyboard.

d)

It allows the programmer to display the value of a variable while the program is running.

8.

What, if anything, is wrong with the following?

input=x("Type your password: ")

print(x)

a)

The variable should be switched with the input command

b)

Input commands don't need ( )

c)

You can't print x

d)

Nothing is wrong

9.

What does int() represent?

a)

internet

b)

integer

c)

intel

d)

input

10.

Why would I get a syntax error?

a)

Line 1 doesn't make sense

b)

Line 2 needs to be indented

c)

No need for quotation marks on line 2

d)

No such thing as an if statement

11.

What would be printed to the screen for print(z)?

a)

Orange

b)

Banana

c)

Cherry

d)

Hello World!

12.

Num = 90

Num = 20

print(Num)

a)

90

b)

4.5

c)

20

d)

1800

13.

What is a definition of SELECTION?

a)

A variable expression

b)

A precise set of step-by-step instructions written in a programming language

c)

When the program checks the conditions and chooses the path based on the outcome

14.

This operator means that one value is equal to the other value

a)
==
b)
!=
c)
>
15.

Which condition represents 'X is greater than Y'

a)

X == Y

b)

X > Y

c)

X < Y

16.

What will this code print?

a)

access denied

b)

access granted

c)

error

d)

password

17.

If the user enters 60, what is the output?

a)

You are old!

b)

You are middle-aged!

c)

You are young!

d)

Error message

18.

What will the code do?

a)

nothing

b)

display Hello Bob

c)

display I don't know you

d)

display Hello

19.

What is the output?

a)

next

stop

b)

next

c)

stop

d)

syntax error - program doesn't work

20.

What is my result?

a)

"Mickey is a mouse"

b)

"Minnie rules"

c)

Nothing prints.

d)

"Mickey is a mouse" & "Minnie rules"

21.

What is my result?

a)

John is getting ice cream

John is getting grapes

b)

John is getting apple juice

John is getting grapes

c)

John is getting apple juice

d)

John is getting ice cream