Python Quiz

Answer 10 questions and see how you score!

1. What is the output of: [i for i in range(3) if i!=1]?

2. What is the result of: all([0,1,2])?

3. Which function converts a number to binary?

4. What is the output of: round(4.567,2)?

5. Which function converts a string to a float?

6. Which method adds multiple elements to a list at once?

7. What is the result of bool([])?

8. Which method returns a string without leading and trailing whitespace?

9. Which of these is used to define an abstract base class?

10. What is the difference between shallow and deep copy?