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
Create a list of even numbers from 0 to 20 using list comprehension.
π‘ Hint: Think about how the iteration and condition are structured.
Question 2
Easy
Use map to convert a list of strings to their lengths: ['Python', 'is', 'fun']
.
π‘ Hint: What function can we use to apply to each string?
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 will list(map(str, [1, 2, 3]))
return?
π‘ Hint: Think about the function being applied.
Question 2
Using list comprehension to create even squares: result = [x**2 for x in range(10) if x % 2 == 0].
How many items will result
contain?
π‘ Hint: Count how many even squares below 10 are there.
Solve and get performance evaluation
Push your limits with challenges.
Question 1
Using list comprehension, create a list of tuples containing the squares of numbers from 1 to 10 along with a boolean indicating if they are even.
π‘ Hint: Consider how to structure the tuple comprising square and boolean.
Question 2
Write a comprehension that generates a list of unique characters from a string, only including alphabetical characters.
π‘ Hint: How do you filter and ensure uniqueness?
Challenge and get performance evaluation