Python Assessment-2

Python Assessment-2

University

20 Qs

quiz-placeholder

Similar activities

Singapore

Singapore

12th Grade - Professional Development

15 Qs

IMPORTANT BRANDING DECISSIONS

IMPORTANT BRANDING DECISSIONS

University

15 Qs

Quiero ser maestro clase demostrativa verbal

Quiero ser maestro clase demostrativa verbal

University

20 Qs

HUC110

HUC110

University

20 Qs

KUIS WEBINAR 2 HGN 61 TAHUN 2021

KUIS WEBINAR 2 HGN 61 TAHUN 2021

7th Grade - Professional Development

15 Qs

Kurikulum dan Pembelajaran FK Univ. YARSI

Kurikulum dan Pembelajaran FK Univ. YARSI

University

15 Qs

Research Sampling

Research Sampling

University

15 Qs

Quiz Ramadhan

Quiz Ramadhan

University

20 Qs

Python Assessment-2

Python Assessment-2

Assessment

Quiz

Education

University

Medium

Created by

Munnangi Vinay

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?