WorksheetsPython Revision
Total questions: 14
Worksheet time: 5mins
What is the data type of this variable?
student = "Maria"
List
Integer
String
Dictionary
What is the data type of this variable?
snake = {"hiss", "glide", "long", "scales"}
String
Tuple
List
Set
What is the data type of this variable?
channel = [{"num": 701, "name":"AXN"}, {"num": 801, "name": "WWE"}, {"num": 105, "name": "PRIMA"}]
List
Dictionary
Set
Tuple
What is the correct syntax for input in Python?
user_input = input("Enter your input")
user_input = input(Enter your input)
user_input = input("Enter your input",enter_num)
user_input = ("Please enter your input")
Which of the print coding below here will show an error?
print("My name is".name)
print("My name is",name)
print("My name is"+str(name))
print(f"My name is {name}")
subject = "Anomaly Detection in Twitter"
print(subjects.upper())
What is the correct output from this code?
ANOMALY DETECTION IN TWITTER
Anomaly Detection in Twitter
anomaly detection in twitter
Error
status = "I like to eat chickens"
print(status[:6]+status[13:])
What is the output of the coding above?
I likechickens
like chickens
I like chickens
eat chickens
names = ["Julia", "Child", "Andrew", "Garfield"]
for i in names:
print(i)
Julia
Child
Andrew
Garfield
Julia Child Andrew Garfield
JuliaChildAndrewGarfield
Julia Child
Andrew Garfield
student = {"name":"Riri","id":"045612"}
How to print the student name?
print(student.name())
print(student[0])
print(student[i])
print(student["name"])
print(11%2)
What is the output of this code?
0
1
0.5
Error
What is the output of this program?
You can work remotely
You have to work in the urban area
Enter the correct age and gender
Error
What is the output of this program?
Finish
Nothing
Error
The program will continue
What is the output of the program?
Error
Your total bill payment is RM 155.0
Your total bill payment is RM 120.0
Your total bill payment is RM 185.0
What is the output of the program?
1
343
491
7
