Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python 4 🐍 incomplete

Total questions: 25

Worksheet time: 55mins

Name
Class
Date
1.

Which of the following is NOT a data type in Python?

a)

String

b)

Char

c)

Integer

d)

Float

2.

How would you print the word "Hello" in Python?

4 lines
3.

What would be the result of 8 / 2 in Python?

a)

8

b)

4

c)

16

d)

2

4.

What does the comma , do in a print function?

4 lines
5.

How would you print the following on two lines? Copy code Hello World

4 lines
6.

How do you save a Python program?

4 lines
7.

How do you combine an integer and a string in a print statement?

4 lines
8.

What will this print? print("Hello", "World")

4 lines
9.

What operation is represented by * in Python?

a)

Addition

b)

Subtraction

c)

Multiplication

d)

Division

10.

What is the purpose of the newline character \n?

4 lines
11.

Which of the following is NOT a valid variable name in Python?

a)

3name

b)

name_3

c)

_name3

d)

nameThree

12.

How do you assign the value 10 to a variable called "number"?

4 lines
13.

If x = 5 and y = 3, what is x + y?

a)

15

b)

8

c)

2

d)

53

14.

How do you print the variable name combined with the string " is great!"?

4 lines
15.

What does the str() function do?

a)

Converts a string to an integer

b)

Checks the length of a string

c)

Converts an integer to a string

d)

Takes user input

16.

What function do you use to get input from a user in Python?

4 lines
17.

How do you convert a string to an integer in Python?

4 lines
18.

If data = "Hello", what is the result of len(data)?

a)

4

b)

5

c)

6

d)

7

19.

How do you change the value stored within a variable?

4 lines
20.

How do you combine the value of variable a with the string " has apples" in a print statement?

4 lines
21.

Which function allows users to personalize outputted statements through input?

4 lines
22.

If a = 5 and b = 3, how do you print their sum as "The total is 8"?

4 lines
23.

Which function helps in checking the length of data within a variable?

a)

int()

b)

str()

c)

input()

d)

len()

24.

What's the result of combining variables x = "5" and y = "3" using + operator?

4 lines
25.

How do you make calculations using variables a = 4 and b = 5 to get their product?

4 lines