Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.
Fun, engaging games to boost memory, math fluency, typing speed, and English skillsβperfect for learners of all ages.
Test your understanding with targeted questions related to the topic.
Question 1
Easy
Write a list comprehension to create a list of the first 10 even numbers.
π‘ Hint: Think about how to define even numbers.
Question 2
Easy
What does the map function return when applied to a list?
π‘ Hint: Remember how to convert it back to a usable list.
Practice 4 more questions and get performance evaluation
Engage in quick quizzes to reinforce what you've learned and check your comprehension.
Question 1
What is the output of 'list(map(lambda x: x**2, [1, 2, 3]))'?
π‘ Hint: Pay attention to what the lambda function does.
Question 2
The following code results in duplicates: for x in range(5): for y in range(x, 5): print(x, y). Determine if True or False.
π‘ Hint: Think about how nested loops interact with their ranges.
Solve and get performance evaluation
Push your limits with challenges.
Question 1
Design a function that generates the squares of all even numbers up to n using only a single comprehension statement.
π‘ Hint: Combine both filtering and mapping in one concise line.
Question 2
Write a program that identifies all pairs of integers (a, b) that form valid Pythagorean triples with a given maximum value n.
π‘ Hint: Remember to control the ranges of your nested loops carefully to prevent redundancy.
Challenge and get performance evaluation