Quiz on Variables Welcome to your Quiz on Variables 1. What is the correct way to declare a variable in Python? var x = 5 int x = 5 x = 5 declare x = 5 2. Which of the following variable names is invalid in Python? my_variable 123variable _variable variable123 3. Which of the following is NOT a Python naming convention for variables? camelCase snake_case PascalCase kebab-case 4. What is a best practice for naming constants in Python? Use lowercase letters with underscores (snake_case) Use all uppercase letters with underscores (UPPER_CASE) Use camelCase Use PascalCase 5. In Python, how do you comment a single line of code? // This is a comment /* This is a comment */ # This is a comment 6. Which of the following is NOT a valid Python variable assignment? x = 5 5 = x x = y = 5 x, y = 5, 6 7. What is the purpose of using meaningful variable names in Python? It makes the code more readable and understandable. It increases the performance of the code. It reduces the size of the code. It helps to obfuscate the code. 8. What happens if you try to access a variable before it is defined in Python? It raises a NameError It assigns the variable the value of None. It raises a SyntaxError. It assigns the variable the value of False. 9. What is the purpose of using underscores (_) in variable names in Python? To indicate a private variable. To separate words in a variable name for better readability (snake_case). To indicate that the variable is a constant. To mark a variable as global. 10. In Python, what is the lifetime of a variable? The duration for which the variable exists in memory. The duration for which the variable is accessible within a function. The duration for which the variable retains its value. The duration for which the variable remains in scope. 1 out of 10 Time's up