Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Revision

Total questions: 14

Worksheet time: 5mins

Name
Class
Date
1.

What is the data type of this variable?

student = "Maria"

a)

List

b)

Integer

c)

String

d)

Dictionary

2.

What is the data type of this variable?

snake = {"hiss", "glide", "long", "scales"}

a)

String

b)

Tuple

c)

List

d)

Set

3.

What is the data type of this variable?

channel = [{"num": 701, "name":"AXN"}, {"num": 801, "name": "WWE"}, {"num": 105, "name": "PRIMA"}]

a)

List

b)

Dictionary

c)

Set

d)

Tuple

4.

What is the correct syntax for input in Python?

a)

user_input = input("Enter your input")

b)

user_input = input(Enter your input)

c)

user_input = input("Enter your input",enter_num)

d)

user_input = ("Please enter your input")

5.

Which of the print coding below here will show an error?

a)

print("My name is".name)

b)

print("My name is",name)

c)

print("My name is"+str(name))

d)

print(f"My name is {name}")

6.

subject = "Anomaly Detection in Twitter"

print(subjects.upper())

What is the correct output from this code?

a)

ANOMALY DETECTION IN TWITTER

b)

Anomaly Detection in Twitter

c)

anomaly detection in twitter

d)

Error

7.

status = "I like to eat chickens"

print(status[:6]+status[13:])

What is the output of the coding above?

a)

I likechickens

b)

like chickens

c)

I like chickens

d)

eat chickens

8.

names = ["Julia", "Child", "Andrew", "Garfield"]

for i in names:

print(i)

a)

Julia

Child

Andrew

Garfield

b)

Julia Child Andrew Garfield

c)

JuliaChildAndrewGarfield

d)

Julia Child

Andrew Garfield

9.

student = {"name":"Riri","id":"045612"}

How to print the student name?

a)

print(student.name())

b)

print(student[0])

c)

print(student[i])

d)

print(student["name"])

10.

print(11%2)

What is the output of this code?

a)

0

b)

1

c)

0.5

d)

Error

11.

What is the output of this program?

a)

You can work remotely

b)

You have to work in the urban area

c)

Enter the correct age and gender

d)

Error

12.

What is the output of this program?

a)

Finish

b)

Nothing

c)

Error

d)

The program will continue

13.

What is the output of the program?

a)

Error

b)

Your total bill payment is RM 155.0

c)

Your total bill payment is RM 120.0

d)

Your total bill payment is RM 185.0

14.

What is the output of the program?

a)

1

b)

343

c)

491

d)

7