What will be the output of the following code?
my_list = [1, 2, 3, 4]
print(my_list[-1])
Python Quiz for Grade 11 List, Tuple & Strings
Quiz
•
Computers
•
11th Grade
•
Hard
santhiict santhiict
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
my_list = [1, 2, 3, 4]
print(my_list[-1])
1
2
3
4
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following methods is used to add an element to a list?
add()
append()
insert()
extend()
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
list1 = [10, 20, 30]
list2 = [40, 50]
list3 = list1 + list2
print(list3)
[10, 20, 30, 40, 50]
[10, 20, 30]
[40, 50, 10, 20, 30]
[[10, 20, 30], [40, 50]]
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens if you try to access a dictionary key that does not exist?
Returns None
Returns 0
Raises a KeyError
Creates a new key
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following methods is used to get all keys from a dictionary?
dict.keys()
dict.values()
dict.items()
dict.get()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
x = "Dubai"
y = "Dubai"
print(x is y)
True
False
None
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
dict1 = {'a': 1, 'b': 2}
dict2 = dict1
dict2['c'] = 3
print(dict1)
{'a': 1, 'b': 2}
{'a': 1, 'b': 2, 'c': 3}
Error
None
15 questions
Basic Python Coding
Quiz
•
11th - 12th Grade
12 questions
Syntax and Logic Errors
Quiz
•
9th - 11th Grade
15 questions
Iteration
Quiz
•
9th - 12th Grade
10 questions
Dictionary in Python
Quiz
•
11th - 12th Grade
11 questions
DIctionary
Quiz
•
11th Grade
15 questions
list in python
Quiz
•
10th - 12th Grade
15 questions
Python Lists
Quiz
•
10th - 12th Grade
10 questions
Python Input/Output
Quiz
•
9th - 12th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University