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
What does the following list comprehension generate? [x ** 2 for x in range(5)]
π‘ Hint: Think of squaring numbers from 0 to 4.
Question 2
Easy
How can you use filter to get only odd numbers from a list?
π‘ Hint: Remember the modulo operator to check for odd numbers.
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 does the following code snippet return: list(map(lambda x: x**3, [1, 2, 3]))
?
π‘ Hint: Think of the operation of raising to the power of 3.
Question 2
Is it true that filter function can only return a list?
π‘ Hint: Recall the output of functional programming functions.
Solve 2 more questions and get performance evaluation
Push your limits with challenges.
Question 1
Create a list comprehension that generates all non-repeating Pythagorean triples from numbers 1 to 50.
π‘ Hint: Remember to prevent duplicates by adjusting the ranges.
Question 2
Write a single-line comprehension that creates a list of tuples representing (number, square) for the first ten natural numbers.
π‘ Hint: Think about how you can use grouping within parentheses.
Challenge and get performance evaluation