Python - Mock Interview Test

1. What is the correct syntax to output "Hello, World" in Python?

2. What is the correct way to create a list in Python?

3. How do you insert an item at the end of a list in Python?

4. How do you declare a function in Python?

5. What is the correct way to create a dictionary in Python?

6. What will be the output of the following Python code?
print(3 * 3 / 2)

7. What is the correct syntax for a for loop in Python?

8. Which of the following is a correct syntax for a while loop in Python?

9. How do you check the type of an object in Python?

10. How do you create a class in Python?

11. What is the output of the following code: print(2 ** 3)?

12. How do you make a Python script executable?

13. What function is used to get the length of a string in Python?

14. How do you import a module in Python?

15. How do you handle exceptions in Python?

16. What is the correct syntax to create a set in Python?

17. What is the output of this Python expression: 10 // 3?

18. Which of the following is an immutable data type in Python?

19. How do you define a class variable in Python?

20. How do you check if a key exists in a dictionary in Python?