Class 11 Computer Science Chapter 2 Introduction To Python Quiz 2 (60 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. Def maximum(x, y):if x > y:return xelif x == y:return 'The numbers are equal'else:return y print(maximum(2, 3))
2. Which of the following data structures in Python are mutable (can be modified later after being created)?List, Dictionary, Tuple
3. Insert the missing part of the code below to output ..... "My name is ".
4. How do you check if a DataFrame contains any missing values?
5. What is the purpose of a function in programming?
6. What is the purpose of the 'print' command in Python?
7. What is the purpose of creating a folder to save files in Python?
8. Which Python statement can be used to catch an Error?
9. Python is case sensitive (T/F)
10. Which character is used in Python to make a single line comment?
11. What does the following Python code do?if user == "Elizabeth":print("Good morning Your Majesty")else:print("Hello", user)
12. ..... is used to define a block of code in programming.
13. What will print(3 + 2) show?
14. What will be printed by the following code? "'pythonlength = 10width = 5print(length * width) "'
15. How do you access the third element in a list called 'colours'?
16. What is one of the goals defined by Guido van Rossum for Python's code?
17. What colour is the information that is that is displayed in the shell?
18. What does the relational operator '<=' represent?
19. All keywords in Python are in lower case (T/F).
20. Is python an object oriented language?
21. An expression can often be evaluated as true or false, for instance print(10>9) would return as true. What is this an example of?
22. What is a correct syntax to get output as "Hello World" in Python?
23. How do you specify a default value for an argument in a function?
24. The operator < means
25. Which of the following would be an example of an integer variable:
26. You can declare string variables with single or double quotes.x = "John"# is the same asx = 'John'
27. Which one is a correct way to get user input?
28. What is the output of print(type(5)) in Python?
29. What is the purpose of the 'def' keyword in Python?
30. How do you take input from a user in Python?
31. Python is named after:
32. Which of the following is NOT a common application of Python?
33. Why data analysis is important?
34. No, a function can only have one return statement
35. What is the result of the following operation:$10 / 4$
36. Which print statement correctly prints a variable called place ..... of ..... birth?
37. Used to structure code in Python
38. Who developed the Python Programming language?
39. The ..... operator checks whether a given value lies within a given set of values
40. To get the last element from a list in Python we can use which index?
41. A data type consisting of numbers letters and symbols:
42. Which of the following is a key feature of Python?
43. What statement can we use to check more conditions in an if ..... else statement?
44. Which of these is used to group code together in Python?
45. You need an ordered container for values that must not change after creation. Which Python data type best fits this need?
46. ..... is a set of valid characters that a language can recognize.
47. What is the output of the following code?def my ..... func ( ):return 5return 10print (my ..... func ( ) )
48. True or False:The output of the following code will always be the same.from random import randintdiceroll = randint(1, 6)print("You rolled a", diceroll)
49. What is the result of the following code? "'pythonnumbers = [7, 8, 9]print(len(numbers)) "'
50. What will be the output after the following statements?x = 6 y = 3 print(x / y)
51. What does the split() function do in Python?
52. What will be the output of the following code:print('Hello' + ' World')?
53. Which function is used to convert a number to a string?
54. What operator would I need to times 5 by 10?
55. What is the output of the following code? "'pythonprint("Great Britain" .replace("Great", "United")) "'
56. What is the data type of the value '"42"' in Python?
57. Used to make comments in a line of python code?
58. To insert an the string "strawberries" in the first position of a list we use
59. Module-1:Which of the following is NOT mentioned as a function topic in Module-1?
60. How do you create a table in SQL?