Adblocker Detected
Quizack provides Online Quiz and Practice MCQs for Free. Please disable your Ad-Blocker so we can earn from ads and keep this project alive.
1. Which statement about strings in Python is true?
2. Given a list defined as numbers = [1,2,3,4], what is the value of numbers[-2]?
3. What will be the output of this code? [1,2,3] * 3
4. Which choice is not a native numerical type in Python?
5. Choose the option below for which instance of the class cannot be created
6. Which choice is an immutable data type?
7. Suppose you have a variale named vector of type np.array with 10,000 elements. How can you turn vector into a variable named matrix with dimensions 100x100?
8. What are the two main data structures in the Pandas library?
9. What is the correct syntax for creating a vaiable that is bound to a list?
10. What two functions within the NumPy library could you use to solve a system of linear equations?
11. How do you add a comment to existing Python script?
12. What Python mechanism is best suited for telling a user they are using a deprecated function
13. In Python, how can the compiler identify the inner block of a for loop?
14. When would you use a try/except block in code?
15. When an array is large, NumPy will not print the entire array when given the built-in print function. What function can you use within NumPy to force it to print the entire array?
16. Which Python function allows you to execute Linux shell commands in Python?
17. What built-in Python data type can be used as a hash table?
18. NumPy allows you to multiply two arrays without a for loop. This is an example of _.
19. Which mode is not a valid way to access a file from within a Python script?
20. Which syntax correctly creates a variable that is bound to a tuple?
21. Elements surrounded by [] are _, {} are _, and () are _.
22. Which command will create a list from 10 down to 1? Example:10,9,8,7,6,5,4,3,2,1
23. What is the correct syntax for calling an instance method on a class named Game?
24. What is the correct syntax for defining a class called Game?
25. What file is imported to use dates in python?
26. What does the // operator in Python 3 allow you to do?
27. You encounter a FileNotFoundException while using just the filename in the open function. What might be the easiest solution?
28. When would you use a while loop?
29. What is the correct syntax for adding a key called variety to the fruit_info dictionary that has a value of Red Delicious?
30. How does defaultdict work?
31. Describe the functionality of a queue?
32. What will happen if you use a while loop and forget to include logic that eventually causes the while loop to stop?
33. How is comment created?
34. What is the correct way to call a function?
35. What is the difference between class attributes and instance attributes?
36. What does a generator return?
37. What is the primary difference between lists and tuples?
38. What is a lambda function ?
39. What is the correct way to run all the doctests in a given file from the command line?
40. Why would you use a virtual environment?
41. Why is it considered good practice to open a file from within a Python script by using the with keyword?
42. What is a base case in a recursive function?
43. Which statement accurately describes how items are added to and removed from a stack?
44. What is the runtime complexity of adding an item to a stack and removing an item from a stack?
45. Why would you use mixin?
46. What is the runtime complexity of searching for an item in a binary search tree?
47. What would happen if you did not alter the state of the element that an algorithm is operating on recursively?
48. When would you use a for loop?
49. Why would you use a decorator?
50. Which of the following is TRUE About how numeric data would be organised in a binary Search tree?
51. What is the correct syntax for creating a variable that is bound to a set?
52. Describe the functionality of a deque.
53. According to the PEP 8 coding style guidelines, how should constant values be named in Python?
54. What is the proper way to define a function?
55. What does it mean for a function to have linear runtime?
56. What statement about the class methods is true?
57. What is the purpose of the self keyword when defining or calling methods on an instance of an object?
58. What is the correct syntax for creating a variable that is bound to a dictionary?
59. What is meant by the phrase "space complexity"?
60. What does a class's __init__() method do?
61. What value would be returned by this check for equality? 5 != 6
62. What symbol(s) do you use to assess equality between two elements?
63. What does calling namedtuple on a collection type return?
64. Suppose a Game class inherits from two parent classes: BoardGame and LogicGame. Which statement is true about the methods of an object instantiated from the Game class?
65. What is the definition of abstraction as applied to object-oriented Python?
66. What is key difference between a set and a list?
67. What is runtime complexity of the list's built-in .append() method?
68. What is the algorithmic paradigm of quick sort?
69. What happens when you use the built-in function all() on a list?
70. Assuming the node is in a singly linked list, what is the runtime complexity of searching for a specific node within a singly linked list?
71. When does a for loop stop iterating?
72. Which collection type is used to associate values with unique keys?
73. What is the term used to describe items that may be passed into a function?
74. What is the purpose of the pass statement in Python?
75. If you don't explicitly return a value from a function, what happens?
76. What does the built-in map() function do?
77. What is the correct syntax for instantiating a new object of the type Game?
78. What built-in Python data type is best suited for implementing a queue?
79. What is the purpose of an if/else statement?
80. Which statement does NOT describe the object-oriented programming concept of encapsulation?
81. What is an instance method?
82. Which of these is NOT a characteristic of namedtuples?
83. What is the purpose of the "self" keyword when defining or calling instance methods?
84. What built-in Python data type is commonly used to represent a stack?
85. What is the correct syntax for defining a class called Game, if it inherits from a parent class called LogicGame?
86. What is the runtime of accessing a value in a dictionary by using its key?
87. What is one of the most common use of Python's sys library?
88. What built-in list method would you use to remove items from a list?
89. What are attributes?
90. What statement about static methods is true?
91. What data structure does a binary tree degenerate to if it isn't balanced properly?
92. What happens when you use the build-in function any() on a list?
93. What is an abstract class?
94. The starting value of an algorithm used to generate a range of numbers is called the _________.
95. The class ____ is the base of the classes designed to handle exceptions.
96. A variable's ________ is the part of a program in which the variable may be accessed.
97. You usually use the for loop with ____ loops.
98. When a function is called by its name, then it is _____.
99. The purpose of the __________ is to get the first input value for the validation of a loop.
100. The _____ of a local variable is the function in which the variable is created
Ajax
Android Programming
Facebook (Programming & App Development)
Shopify
JSON
Ruby on Rails
Related MCQ's