
Python Quiz 6

Quiz
•
Computers
•
University
•
Hard
Nguyen Duong
FREE Resource
70 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code? b=[2,3,4,5] a=list(filter(lambda x:x%2,b)) print(a)
[2,4]
[]
[3,5]
Invalid arguments for filter function
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code? lst=[3,4,6,1,2] lst[1:2]=[7,8] print(lst)
[3, 7, 8, 6, 1, 2]
Syntax error
[3,[7,8],6,1,2]
[3,4,6,7,8]
3.
MULTIPLE CHOICE QUESTION
30 sec • 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]
Syntax error
[1,2,3]
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code? >>> a=[14,52,7] >>>> b=a.copy() >>> b is a
True
False
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code? a=[13,56,17] a.append([87]) a.extend([45,67]) print(a)
[13, 56, 17, [87], 45, 67]
[13, 56, 17, 87, 45, 67]
[13, 56, 17, 87,[ 45, 67]]
[13, 56, 17, [87], [45, 67]]
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following piece of code? a=list((45,)*4) print((45)*4) print(a)
180
[(45),(45),(45),(45)]
(45,45,45,45)
[45,45,45,45]
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code? lst=[[1,2],[3,4]] print(sum(lst,[]))
[3],[7]
[1,2,3,4]
Error
[10]
Create a free account and access millions of resources
Similar Resources on Wayground
68 questions
Principle of Programming

Quiz
•
University
65 questions
PTI (susulan) - UAS

Quiz
•
10th Grade - University
71 questions
MSTIP-Python-FinalExam

Quiz
•
University
65 questions
PreTest - Python

Quiz
•
University
70 questions
OOAD Midterm Review - 24.25

Quiz
•
University
65 questions
1371 CSCI Mid Term

Quiz
•
University
70 questions
Review for Fall Semester Exam - CTE

Quiz
•
8th Grade - University
75 questions
Examen DFD y Python

Quiz
•
University
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade