← All topics
Quiz: Comprehensions and Lambda: questions with answers
15 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What does [x 2 for x in range(4)] give?
- Q2. What does [c for c in "hello" if c not in "aeiou"] give?
- Q3. What does list(map(len, ["a", "bb", "ccc"])) return?
- Q4. What is max(["kiwi", "banana", "fig"], key=len)?
- Q5. What is missing from a recursive function that causes a RecursionError?
- Q6. What does this print? (code)
- Q7. What does this print? (code)
- Q8. What does this print? (code)
- Q9. What does this print? (code)
- Q10. What does this print? (code)
- Q11. What does this print? (code)
- Q12. What does this print? (code)
- Q13. What does this print? (code)
- Q14. What does this print? (code)
- Q15. Why does the plain recursive Fibonacci become very slow for large n, and what fixes it?