What will be the output of the following Python code?
l1=[2,4,6]
l2=[-2,-4,-6]
for i in zip(l1, l2):
print(i)
Python Data types & Exceptions
Quiz
•
Computers
•
1st - 10th Grade
•
Hard
Humera I
Used 33+ times
FREE Resource
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Python code?
l1=[2,4,6]
l2=[-2,-4,-6]
for i in zip(l1, l2):
print(i)
2, -2
4, -4
6, -6
[(2, -2), (4, -4), (6, -6)]
(2, -2)
(4, -4)
(6, -6)
[-4, -16, -36]
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Python code?
a=[1,2,3]
b=a.append(4)
print(a)
print(b)
[1,2,3,4]
[1,2,3,4]
[1, 2, 3, 4]
None
Syntax error
[1,2,3]
[1,2,3,4]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code
aTuple = (100, 200, 300, 400, 500)
aTuple[1] = 800
print(aTuple)
TypeError
(100, 800, 200, 300, 400, 500)
(800, 100, 200, 300, 400, 500)
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following tuple operation
aTuple = (100,)
print(aTuple * 2)
TypeError
(100, 100)
(200)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the correct way to access value 20 from the following tuple
aTuple = ("Orange", [10, 20, 30], (5, 15, 25))
aTuple[1:2][1]
aTuple[1:2](1)
aTuple[1:2][1]
aTuple[1][1]
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code
aTuple = (100, 200, 300, 400, 500)
print(aTuple[-2])
print(aTuple[-4:-1])
IndexError: tuple index out of range
400
(200, 300, 400)
(200,300,400)
300,400,500
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use?
d.size()
len(d)
size(d)
d.len()
18 questions
Computer Science (Python)
Quiz
•
9th Grade
13 questions
Program Development - Python: Errors
Quiz
•
8th - 10th Grade
17 questions
Python KS3
Quiz
•
8th Grade
10 questions
iav ML Study Group Pop Quiz 4
Quiz
•
1st - 2nd Grade
16 questions
Arithmetic Types Declare Initialize Relation Logical Ops
Quiz
•
9th Grade - University
15 questions
Strings, sets, dicts, files, exceptions
Quiz
•
9th - 12th Grade
15 questions
Creating and Altering Data Structure
Quiz
•
9th - 12th Grade
14 questions
Python: списки, кортеж, словник, множина
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
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
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
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