Python Quiz

Answer 10 questions and see how you score!

1. Which of these is a mutable data type?

2. Which is the correct way to open a file for reading and writing?

3. Which module is used for regular expressions?

4. Which keyword is used for functions?

5. Which method returns True if all elements are true in an iterable?

6. What is the output of: {i**2 for i in range(3)}?

7. What is the output of: list(map(lambda x:x**2, filter(lambda x:x%2==0, [1,2,3,4])))?

8. Which of these correctly defines a generator function?

9. Which method sorts a list in descending order?

10. What will print(list(map(lambda x:x*2, [1,2,3]))) output?