wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Intro to Python

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

What is a variable?

a)

A math operator

b)

An element, feature, or factor that is liable to vary or change.

c)

An if statement

d)

A computer system that can change

2.

What does print("hello) display?

a)

hello

b)

gives you an error

c)

"hello"

d)

"hello

3.

True is a boolean

a)

True

b)

False

c)

Neither

4.

What does \n do?

a)

Adds a quotation

b)

Creates a number

c)

Adds a new line

d)

Adds a fullstop

5.

What does the following code display?


a = 1

b = 2

print(a + a)

a)

2

b)

3

c)

4

d)

22

6.

What is casting?

a)

When you convert a variable value from one type to another.

b)

When you assign a string

c)

When you create a boolean

d)

When you display an integer

7.

What symbol would you use to add a comment to your code?

a)

//

b)

#

c)

-

d)

]]

8.

What is the answer to?

print(10 % 4)

a)

1

b)

3

c)

2

d)

4

9.

'my name' is a valid variable?

a)

No

b)

Yes

10.

How do you ask an input from a user?

a)

name = int("what is your name")

b)

name = input(what is your name?)

c)

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

d)

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