Python Quiz python 1 / 20print("Hello, World!") Hello, World Hello World Hello, World! Hello World! 2 / 20Which of the following is a valid variable name in Python? 1_variable variable-1 variable_1 variable 1 3 / 20What is the correct file extension for Python files? .pyth .py .pt .pyt 4 / 20How do you insert COMMENTS in Python code? // This is a comment <!-- This is a comment --> # This is a comment /* This is a comment */ 5 / 20Which keyword is used to create a function in Python? func define def function 6 / 20What is the correct syntax to define a class in Python? class MyClass: MyClass class: class = MyClass: def MyClass: 7 / 20How do you start a for loop in Python? for (i = 0; i < 10; i++) for i in range(10): for i = 1 to 10 for i < 10: 8 / 20list = [1, 2, 3, 4, 5] print(list[2]) 2 3 4 5 9 / 20How do you create a list in Python? list = {1, 2, 3} list = (1, 2, 3) list = [1, 2, 3] list = 10 / 20What is the output of the following code?x = 5y = 10print(x + y) 15 510 5 + 10 Error 11 / 20Which of the following is a mutable data type in Python? str tuple int list 12 / 20How do you import a module in Python? include module_name import module_name using module_name require module_name 13 / 20What is the output of the following code?x = [1, 2, 3]y = xy.append(4)print(x) [1, 2, 3] [1, 2, 3, 4] [4, 1, 2, 3] Error 14 / 20Which of the following is used to handle exceptions in Python? try/except do/except try/catch do/catch 15 / 20What will be the output of the following code?def func(a, b=2, c=3): return a + b + cprint(func(1, c=4)) 6 7 8 Error 16 / 20Which of the following is the correct way to create a set in Python? set = [1, 2, 3] set = {1, 2, 3} set = (1, 2, 3) set = 17 / 20How do you create a dictionary in Python? dict = [1, 2, 3] dict = {1, 2, 3} dict = {'one': 1, 'two': 2} dict = (1, 2, 3) 18 / 20What is the output of the following code?def add(x, y): return x + yprint(add("Hello", "World")) HelloWorld Hello World Error Hello, World 19 / 20Which of the following methods would you use to find the index of an element in a list? list.find(x) list.index(x) list.search(x) list.lookup(x) 20 / 20What will be the output of the following code?a = {1, 2, 3}b = {3, 4, 5}print(a & b) {3} {} {1, 2, 3, 4, 5} {1, 2} Your score isThe average score is 36% 0% Restart quiz