Basic Python Knowledge Quiz Question Title * 1. Which of the following best describes Python? (Required.) A high-level programming language A type of snake A database system A markup language Question Title * 2. Which of the following is a correct variable name in Python? (Required.) variable.name variable-name variable_name 1variable Question Title * 3. What is the output of the following code: print(type(42)) (Required.) <class 'float'> <class 'int'> <class 'bool'> <class 'str'> Question Title * 4. Which symbol is used for comments in Python? (Required.) # // /* */ -- Question Title * 5. What does the following code do: x = [1, 2, 3, 4] print(x[2]) (Required.) Throws an error Prints 4 Prints 3 Prints 2 Question Title * 6. How do you create a list in Python? (Required.) list = {} list = [] list = () list = <> Question Title * 7. What will be the output of the following code: print(3 ** 2) (Required.) 3 8 6 9 Question Title * 8. Which of the following is not a Python data type? (Required.) dictionary integer tuple array Question Title * 9. What does the len() function do? (Required.) Converts a string to uppercase Calculates the sum of numbers Returns the type of a variable Returns the length of a list Question Title * 10. How do you start a function in Python? (Required.) def functionName(): func functionName(): function functionName(): functionName(): Question Title * 11. Which keyword is used to create a loop in Python? (Required.) for repeat iterate loop Question Title * 12. What is the correct way to import a module in Python? (Required.) load math include math using math import math Question Title * 13. What is the output of the following code: print(10 // 3) (Required.) 3.33 4 Error 3 Question Title * 14. How do you add an item to a list in Python? (Required.) list.insert(item) list.append(item) list.push(item) list.add(item) Question Title * 15. What is the result of the following expression: 5 == 5 (Required.) False Error None True Question Title * 16. How do you declare a dictionary in Python? (Required.) dict = {} dict = [] dict = <> dict = () Question Title * 17. What is the purpose of the "break" statement in a loop? (Required.) To restart the loop To pause the loop To skip the current iteration To terminate the loop Question Title * 18. What does the following code return: "Hello, World!".lower() (Required.) "Hello, World!" Error "hello, world!" "HELLO, WORLD!" Question Title * 19. Which of these is a valid way to handle exceptions in Python? (Required.) catch-finally try-except if-else handle-error Question Title * 20. What is the output of the following code: print(bool(0)) (Required.) True False Error 0 Question Title * 21. How do you create a tuple in Python? (Required.) tuple = () tuple = {} tuple = <> tuple = [] Question Title * 22. What will the following code print: x = "Python" print(x[0:-3]) (Required.) Error Pyth thon Pyt Question Title * 23. How do you check the type of a variable in Python? (Required.) typeOf(variable) checkType(variable) type(variable) typeof(variable) Question Title * 24. What is the purpose of the "pass" statement in Python? (Required.) To raise an error To stop a function To do nothing To skip a loop Question Title * 25. What will this code output: print("Python " + "Quiz") (Required.) PythonQuiz Python Quiz Error None Done