Python Assessment-2

Quiz
•
Education
•
University
•
Medium
Munnangi Vinay
Used 3+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a valid way to call a function in Python?
call add()
add()
function add()
def add()
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which function is used to apply a function to all the elements in an iterable?
filter()
map()
reduce()
apply()
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code snippet?
def square(x):
return x * x
numbers = [1, 2, 3, 4, 5]
squared_numbers = map(square, numbers)
print(list(squared_numbers))
[1, 4, 9, 16, 25]
[2, 4, 6, 8, 10]
[1, 2, 3, 4, 5]
[1, 8, 27, 64, 125]
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
numbers = [1, 2, 3, 4, 5]
result = list(map(lambda x: x * 2, numbers))
print(result)
[1, 2, 3, 4, 5]
[2, 4, 6, 8, 10]
[2, 3, 4, 5, 6]
[1, 4, 9, 16, 25]
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a valid set in Python?
{1, 2, 3, 3, 4}
{1, 2, [3, 4]}
{1, 2, (3, 4)}
{1, 2, {3, 4}}
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
words = ["apple", "banana", "orange", "kiwi"]
result = list(filter(lambda x: len(x) > 5, words))
print(result)
["apple" ,"banana"]
["orange", "kiwi"]
["apple" ,"orange"]
["banana","orange"]
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
numbers = [ ]
result = map(lambda x: x, numbers)
print(list(result))
[ ]
None
[0]
[None]
Create a free account and access millions of resources
Similar Resources on Wayground
24 questions
FIXIT FEST - LEO CLUB (DAY - 2)

Quiz
•
University
20 questions
Round 1- Code Crunch

Quiz
•
University
21 questions
practice

Quiz
•
University
15 questions
Python Basics

Quiz
•
University
20 questions
C Programming Quiz

Quiz
•
University
20 questions
Introduction to Machine Learning

Quiz
•
University - Professi...
15 questions
ExpePsych Icebreaker

Quiz
•
University
18 questions
TLAC 3.0 QUIZZ

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Education
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University