wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Year 9 lower Python

Total questions: 10

Worksheet time: 9mins

Name
Class
Date
1.

What input will I need to collect the height (in cm) of pupils in a class?

a)

float

b)

Int

c)

input

2.

What does a variable do?

a)

Stores a value in memory

b)

Helps you print to screen

c)

It works out the maths

3.

What does the round function do in Python?

a)

makes circles

b)

Rounds to a decimal place

c)

Tells you how many letters are in a word

4.

Using the round function for the value 46.843 to 2 decimal places, the answer would be?

a)

46.82

b)

46.85

c)

46.87

d)

46.84

5.

What would be the answer here?

x = "hello"

print(len(x))

a)

2

b)

3

c)

4

d)

5

6.

What would the answer be?

x = input("enter a number ")

print(x+x)

a)

33

b)

31

c)

error

7.

What would be the answer?

a = "564"

b = "2342"

print(a+b)

a)

2609

b)

5642324

c)

2906

8.

What would happen here?


a = input ("enter a number")

b = int(input("enter a number"))

print (a+b)

a)

It would add the 2 numbers

b)

It would join the 2 numbers together

c)

There would be an error

9.

which code below is correct?


a = 1995

b = 2050

a)

print("in ", you will be , b - a)

b)

print("in ",b, you will be , b - a)

c)

print(" in ", b, "you will be" , b - a)

10.

which 2 lines are incorrect here?


a = input("enter a number")

b = float(input("enter a decimal number"))

c = (round(a))

print(d)

a)

Line 1

b)

Line 2

c)

Line 3

d)

Line 4