Test Python

Test Python

Here is a test to evaluate the skills acquired on the Python language, specifically this is a quiz about the lambda function.

Evaluate your skills on basic and advanced Python concepts with tests created on Creative Coding.

24
Created on By Cristina

Python Lambda function Quiz

1 / 5

What will be the output of this code?

list_number = [11,8,4,5]
new_list = list(filter(lambda x: x > 5, list_number))
print(new_list)

2 / 5

What will be the output of this code?
list_number = [11,-8,4,-5]
my_number = [number for number in list_number if number > 0]
print(my_number)

3 / 5

What will be the output of this code?

f1 = lambda x : x + 2
f2 = lambda x: x * 2

y = 2

y = f1(y)
y = f2(y)
y = f1(y)

print(y)

4 / 5

What will this program print?
list_number = [11,8,4,5]
new_list = list(map(lambda x: x%2==0, list_number))
print(new_list)

5 / 5

What will be the output of this code?
f_cube = lambda x : x * x * x
f_square = lambda x: x * x

y = 2

y = f_square(y)
y = f_cube(y)

print(y)

Your score is

The average score is 68%

0%

 

Write in the comments any doubts or difficulties or if something is wrong in your opinion!
Follow our tutorial to always learn new concepts at the following link: https://www.codingcreativo.it/en/python-tutorial/

Here are some useful links you can find on the blog:

Python lambda function

Use Python dictionaries

Python readline()

Python max()

Break Python

Insertion Sort

Merge Sort

Quick Sort

Leave a Reply

Your email address will not be published. Required fields are marked *