wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python (The Basics)

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

num1 = 93. num1 is a ...

a)

Integer

b)

operator

c)

value

d)

variable

2.

Which operator is the division symbol?

a)

+

b)

*

c)

/

d)

\

3.

which operator is the whole number division symbol ?

a)

/

b)

\

c)

//

d)

*

4.

What is the function that displays a message on the screen ?

a)

print()

b)

input()

c)

int(input())

d)

write()

5.

What is the function that takes in the user's text value input ?

a)

print()

b)

input()

c)

int(input())

d)

apple juice

6.

How do you ask the user to type in a whole number value?

a)

int(input())

b)

input()

c)

input(int())

d)

Ask them to fill out a survey

7.

Whenever you take in a user input value, the value must be stored inside a..

a)

a safe

b)

another value

c)

variable

d)

a pizza box

8.

Which of these is correctly coded?

a)

num = int(input()

b)

num = int(input('Please enter a number: ')

c)

num = int(input('Please enter your age: '))

d)

num = input('Enter a number value )

9.

Which of these is incorrect?

a)

name = input()

b)

name = input('Please enter your name: ')

c)

name = input('Please enter the name of your cat: ')

d)

name = print('Please enter your name: ')

10.

What is Python named after?

a)

A snake

b)

A movie called "Monty Python's Holy Grail"

c)

A villain from an old school TV show

d)

Nothing

11.

What is the name of the environment in Python that write your programs and then test them out ?

a)

Shell

b)

IDLE

c)

Windows

d)

CLI

12.

What does the term debugging mean?

a)

identifying errors and fixing them

b)

a set of instructions

c)

making a calculation

d)

looking at code

13.

What does the Python print function do ?

a)

Its a variable

b)

it displays something like a string or integer

c)

it can be input data

d)

It loops the code

14.

What symbol do you use to make a comment in Python ?

a)

#

b)

@

c)

)

d)

%

15.

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

a)

/

b)

\|

c)

\n

d)

n

16.

What is a variable?

a)

A box (memory location) where you store values

b)

Data Type

c)

A Type of Graphics

d)

A Type of Memory

17.

What symbol is used in Python to assign values to a variable?

a)

=

b)

/

c)

+

d)

*

18.

What will the output be?


name = 'Mr.Lannon'

print(name)

a)

Mr.Lannon

b)

Error

c)

'Mr.Lannon'

d)

MrLannon

19.

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

a)

True

b)

False

20.

What is Python ?

a)

text based programming language

b)

spreadsheet

c)

word processor

d)

block based programming language