Python Quiz

Answer 10 questions and see how you score!

1. Which loop is used when number of iterations is known?

2. What does the @staticmethod decorator do?

3. Which of these is used to define a property of a class?

4. Which of these is correct to handle exceptions with finally?

5. What will be printed? print("a","b",sep="-",end="!")

6. What is the output of print(type([]))?

7. Which module is used to serialize and deserialize Python objects?

8. Which function converts bytes to string?

9. Which operator is for exponentiation?

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