MCQs > IT & Programming > Python MCQs > Basic Python MCQs

Basic Python MCQ

1. Declare k as integer set k = ______ while names[k] != zzz write names[k] set k = k + 1 end while

Answer

Correct Answer: 0

Note: This Question is unanswered, help us to find answer for this one

2. Which statement about strings in Python is true?

Answer

Correct Answer: Strings can be enclosed by double quotes (

Note: This Question is unanswered, help us to find answer for this one

3. Given a list defined as numbers = [1,2,3,4], what is the value of numbers[-2]?

Answer

Correct Answer: 3

Note: This Question is unanswered, help us to find answer for this one

4. What will be the output of this code? [1,2,3] * 3

Answer

Correct Answer: [1, 2, 3, 1, 2, 3, 1, 2, 3]

Note: This Question is unanswered, help us to find answer for this one

5. Which choice is not a native numerical type in Python?

Answer

Correct Answer: Double

Note: This Question is unanswered, help us to find answer for this one

6. Choose the option below for which instance of the class cannot be created

Answer

Correct Answer: Abstract Class

Note: This Question is unanswered, help us to find answer for this one

7. Which choice is an immutable data type?

Answer

Correct Answer: String

Note: This Question is unanswered, help us to find answer for this one

8. 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?

Answer

Correct Answer: Matrix = vector.reshape(100, 100)

Note: This Question is unanswered, help us to find answer for this one

9. What are the two main data structures in the Pandas library?

Answer

Correct Answer: Series and DataFrames

Note: This Question is unanswered, help us to find answer for this one

10. What is the correct syntax for creating a vaiable that is bound to a list?

Answer

Correct Answer: My_list = [2, 'apple', 3.5]

Note: This Question is unanswered, help us to find answer for this one

11. What two functions within the NumPy library could you use to solve a system of linear equations?

Answer

Correct Answer: Linalg.eig() and .matmul()

Note: This Question is unanswered, help us to find answer for this one

12. How do you add a comment to existing Python script?

Answer

Correct Answer: # This is a comment

Note: This Question is unanswered, help us to find answer for this one

13. What Python mechanism is best suited for telling a user they are using a deprecated function

Answer

Correct Answer: Warnings

Note: This Question is unanswered, help us to find answer for this one

14. In Python, how can the compiler identify the inner block of a for loop?

Answer

Correct Answer: Because of the level of indentation after the for loop

Note: This Question is unanswered, help us to find answer for this one

15. When would you use a try/except block in code?

Answer

Correct Answer: You use try/except blocks when you want to run some code, but need a way to execute different code if an exception is raised.

Note: This Question is unanswered, help us to find answer for this one

16. 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?

Answer

Correct Answer: Set_printoptions

Note: This Question is unanswered, help us to find answer for this one

17. Which Python function allows you to execute Linux shell commands in Python?

Answer

Correct Answer: Os.system()

Note: This Question is unanswered, help us to find answer for this one

18. What built-in Python data type can be used as a hash table?

Answer

Correct Answer: Dictionary

Note: This Question is unanswered, help us to find answer for this one

19. NumPy allows you to multiply two arrays without a for loop. This is an example of _.

Answer

Correct Answer: Vectorization

Note: This Question is unanswered, help us to find answer for this one

20. Which mode is not a valid way to access a file from within a Python script?

Answer

Correct Answer: Scan('s')

Note: This Question is unanswered, help us to find answer for this one

21. Which syntax correctly creates a variable that is bound to a tuple?

Answer

Correct Answer: My_tuple = (2, 'apple', 3.5)

Note: This Question is unanswered, help us to find answer for this one

22. Elements surrounded by [] are _, {} are _, and () are _.

Answer

Correct Answer: Lists; dictionaries or sets; tuples

Note: This Question is unanswered, help us to find answer for this one

23. Which command will create a list from 10 down to 1? Example:10,9,8,7,6,5,4,3,2,1

Answer

Correct Answer: List(reversed(range(1,11)))

Note: This Question is unanswered, help us to find answer for this one

24. What is the correct syntax for calling an instance method on a class named Game?

Answer

Correct Answer: My_game = Game() my_game.roll_dice()

Note: This Question is unanswered, help us to find answer for this one

25. What is the correct syntax for defining a class called Game?

Answer

Correct Answer: Class Game: pass

Note: This Question is unanswered, help us to find answer for this one

26. What file is imported to use dates in python?

Answer

Correct Answer: Datetime

Note: This Question is unanswered, help us to find answer for this one

27. What does the // operator in Python 3 allow you to do?

Answer

Correct Answer: Perform integer division

Note: This Question is unanswered, help us to find answer for this one

28. You encounter a FileNotFoundException while using just the filename in the open function. What might be the easiest solution?

Answer

Correct Answer: Copy the file to the same directory as where the script is running from

Note: This Question is unanswered, help us to find answer for this one

29. When would you use a while loop?

Answer

Correct Answer: When you want some code to continue running as long as some condition is true

Note: This Question is unanswered, help us to find answer for this one

30. What is the correct syntax for adding a key called variety to the fruit_info dictionary that has a value of Red Delicious?

Answer

Correct Answer: Fruit_info['variety'] = 'Red Delicious'

Note: This Question is unanswered, help us to find answer for this one

31. How does defaultdict work?

Answer

Correct Answer: If you try to read from a defaultdict with a nonexistent key, a new default key-value pair will be created for you instead of throwing a KeyError.

Note: This Question is unanswered, help us to find answer for this one

32. Describe the functionality of a queue?

Answer

Correct Answer: A queue adds items to either end and removes items from either end.

Note: This Question is unanswered, help us to find answer for this one

33. What will happen if you use a while loop and forget to include logic that eventually causes the while loop to stop?

Answer

Correct Answer: Your code will get stuck in an infinite loop.

Note: This Question is unanswered, help us to find answer for this one

34. How is comment created?

Answer

Correct Answer: # This is a comment

Note: This Question is unanswered, help us to find answer for this one

35. What is the correct way to call a function?

Answer

Correct Answer: Get_max_num([57, 99, 31, 18])

Note: This Question is unanswered, help us to find answer for this one

36. What is the difference between class attributes and instance attributes?

Answer

Correct Answer: Class attributes are shared by all instances of the class. Instance attributes may be unique to just that instance

Note: This Question is unanswered, help us to find answer for this one

37. What does a generator return?

Answer

Correct Answer: An iterable object

Note: This Question is unanswered, help us to find answer for this one

38. What is the primary difference between lists and tuples?

Answer

Correct Answer: Lists are mutable, meaning you can change the data that is inside them at any time. Tuples are immutable, meaning you cannot change the data that is inside them once you have created the tuple.

Note: This Question is unanswered, help us to find answer for this one

39. What is a lambda function ?

Answer

Correct Answer: A small, anonymous function that can take any number of arguments but has only expression to evaluate

Note: This Question is unanswered, help us to find answer for this one

40. What is the correct way to run all the doctests in a given file from the command line?

Answer

Correct Answer: Python3 -m doctest <_filename_>

Note: This Question is unanswered, help us to find answer for this one

41. Why would you use a virtual environment?

Answer

Correct Answer: Virtual environments create a

Note: This Question is unanswered, help us to find answer for this one

42. Why is it considered good practice to open a file from within a Python script by using the with keyword?

Answer

Correct Answer: When you open a file using the with keyword in Python, Python will make sure the file gets closed, even if an exception or error is thrown.

Note: This Question is unanswered, help us to find answer for this one

43. What is a base case in a recursive function?

Answer

Correct Answer: A base case is the condition that allows the algorithm to stop recursing. It is usually a problem that is small enough to solve directly.

Note: This Question is unanswered, help us to find answer for this one

44. Which statement accurately describes how items are added to and removed from a stack?

Answer

Correct Answer: A stacks adds items to the top and removes items from the top.

Note: This Question is unanswered, help us to find answer for this one

45. What is the runtime complexity of adding an item to a stack and removing an item from a stack?

Answer

Correct Answer: Add items to a stack in O(1) time and remove items from a stack in O(1) time.

Note: This Question is unanswered, help us to find answer for this one

46. Why would you use mixin?

Answer

Correct Answer: If you have many classes that all need to have the same functionality, you'd use a mixin to define that functionality.

Note: This Question is unanswered, help us to find answer for this one

47. What is the runtime complexity of searching for an item in a binary search tree?

Answer

Correct Answer: The runtime for searching in a binary search tree is generally O(h), where h is the height of the tree.

Note: This Question is unanswered, help us to find answer for this one

48. What would happen if you did not alter the state of the element that an algorithm is operating on recursively?

Answer

Correct Answer: You would eventually get a KeyError when the recursive portion of the code ran out of items to recurse on.

Note: This Question is unanswered, help us to find answer for this one

49. When would you use a for loop?

Answer

Correct Answer: When you need to check every element in an iterable of known length.

Note: This Question is unanswered, help us to find answer for this one

50. Why would you use a decorator?

Answer

Correct Answer: You use the decorator to alter the functionality of a function without having to modify the functions code.

Note: This Question is unanswered, help us to find answer for this one

51. Which of the following is TRUE About how numeric data would be organised in a binary Search tree?

Answer

Correct Answer: For any given Node in a binary Search Tree, the child node to the left is less than the value of the given node and the child node to its right is greater than the given node.

Note: This Question is unanswered, help us to find answer for this one

52. What is the correct syntax for creating a variable that is bound to a set?

Answer

Correct Answer: My_set = {0, 'apple', 3.5}

Note: This Question is unanswered, help us to find answer for this one

53. Describe the functionality of a deque.

Answer

Correct Answer: A deque adds items at either or both ends, and remove items at either or both ends.

Note: This Question is unanswered, help us to find answer for this one

54. According to the PEP 8 coding style guidelines, how should constant values be named in Python?

Answer

Correct Answer: In all caps with underscores separating words -- e.g. MAX_VALUE = 255

Note: This Question is unanswered, help us to find answer for this one

55. What is the proper way to define a function?

Answer

Correct Answer: Def get_max_num(list_of_nums): # body of function goes here

Note: This Question is unanswered, help us to find answer for this one

56. What does it mean for a function to have linear runtime?

Answer

Correct Answer: The amount of time it takes the function to complete grows linearly as the input size increases.

Note: This Question is unanswered, help us to find answer for this one

57. What statement about the class methods is true?

Answer

Correct Answer: A class method can modify the state of the class, but they can't directly modify the state of an instance that inherits from that class.

Note: This Question is unanswered, help us to find answer for this one

58. What is the purpose of the self keyword when defining or calling methods on an instance of an object?

Answer

Correct Answer: Self refers to the instance whose method was called.

Note: This Question is unanswered, help us to find answer for this one

59. What is the correct syntax for creating a variable that is bound to a dictionary?

Answer

Correct Answer: Fruit_info = {'fruit': 'apple', 'count': 2, 'price': 3.5}

Note: This Question is unanswered, help us to find answer for this one

60. What is meant by the phrase "space complexity"?

Answer

Correct Answer: The amount of space taken up in memory as a function of the input size

Note: This Question is unanswered, help us to find answer for this one

61. What does a class's __init__() method do?

Answer

Correct Answer: It is a method that acts as a constructor and is called automatically whenever a new object is created from a class. It sets the initial state of a new object.

Note: This Question is unanswered, help us to find answer for this one

62. What value would be returned by this check for equality? 5 != 6

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

63. What symbol(s) do you use to assess equality between two elements?

Answer

Correct Answer: ==

Note: This Question is unanswered, help us to find answer for this one

64. What does calling namedtuple on a collection type return?

Answer

Correct Answer: A tuple subclass with iterable named fields

Note: This Question is unanswered, help us to find answer for this one

65. 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?

Answer

Correct Answer: An instance of the Game class will inherit whatever methods the BoardGame and LogicGame classes have.

Note: This Question is unanswered, help us to find answer for this one

66. What is the definition of abstraction as applied to object-oriented Python?

Answer

Correct Answer: Abstraction means the implementation is hidden from the user, and only the relevant data or information is shown.

Note: This Question is unanswered, help us to find answer for this one

67. What is key difference between a set and a list?

Answer

Correct Answer: A set is an unordered collection unique items. A list is an ordered collection of non-unique items.

Note: This Question is unanswered, help us to find answer for this one

68. What is runtime complexity of the list's built-in .append() method?

Answer

Correct Answer: O(1), also called constant time

Note: This Question is unanswered, help us to find answer for this one

69. What is the algorithmic paradigm of quick sort?

Answer

Correct Answer: Divide and conquer

Note: This Question is unanswered, help us to find answer for this one

70. What happens when you use the built-in function all() on a list?

Answer

Correct Answer: The all() function returns True if all items in the list evaluate to True. Otherwise, it returns False.

Note: This Question is unanswered, help us to find answer for this one

71. 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?

Answer

Correct Answer: The runtime is O(n) because in the worst case, the node you are searching for is the last node, and every node in the linked list must be visited.

Note: This Question is unanswered, help us to find answer for this one

72. When does a for loop stop iterating?

Answer

Correct Answer: When it has assessed each item in the iterable it is working on or a break keyword is encountered

Note: This Question is unanswered, help us to find answer for this one

73. Which collection type is used to associate values with unique keys?

Answer

Correct Answer: Dictionary

Note: This Question is unanswered, help us to find answer for this one

74. What is the term used to describe items that may be passed into a function?

Answer

Correct Answer: Arguments

Note: This Question is unanswered, help us to find answer for this one

75. What is the purpose of the pass statement in Python?

Answer

Correct Answer: It is a null operation used mainly as a placeholder in functions, classes, etc.

Note: This Question is unanswered, help us to find answer for this one

76. If you don't explicitly return a value from a function, what happens?

Answer

Correct Answer: If the return keyword is absent, the function will return None.

Note: This Question is unanswered, help us to find answer for this one

77. What does the built-in map() function do?

Answer

Correct Answer: It converts a complex value type into simpler value types.

Note: This Question is unanswered, help us to find answer for this one

78. What is the correct syntax for instantiating a new object of the type Game?

Answer

Correct Answer: My_game = Game()

Note: This Question is unanswered, help us to find answer for this one

79. What built-in Python data type is best suited for implementing a queue?

Answer

Correct Answer: List

Note: This Question is unanswered, help us to find answer for this one

80. What is the purpose of an if/else statement?

Answer

Correct Answer: It executes one chunk of code if a condition is true, but a different chunk of code if the condition is false.

Note: This Question is unanswered, help us to find answer for this one

81. Which statement does NOT describe the object-oriented programming concept of encapsulation?

Answer

Correct Answer: It only allows the data to be changed by methods.

Note: This Question is unanswered, help us to find answer for this one

82. What is an instance method?

Answer

Correct Answer: Instance methods can modify the state of an instance or the state of its parent class.

Note: This Question is unanswered, help us to find answer for this one

83. Which of these is NOT a characteristic of namedtuples?

Answer

Correct Answer: No import is needed to use namedtuples because they are available in the standard library.

Note: This Question is unanswered, help us to find answer for this one

84. What is the purpose of the "self" keyword when defining or calling instance methods?

Answer

Correct Answer: Self refers to the instance whose method was called.

Note: This Question is unanswered, help us to find answer for this one

85. What built-in Python data type is commonly used to represent a stack?

Answer

Correct Answer: List

Note: This Question is unanswered, help us to find answer for this one

86. What is the correct syntax for defining a class called Game, if it inherits from a parent class called LogicGame?

Answer

Correct Answer: Class Game(LogicGame): pass

Note: This Question is unanswered, help us to find answer for this one

87. What is the runtime of accessing a value in a dictionary by using its key?

Answer

Correct Answer: O(1), also called constant time.

Note: This Question is unanswered, help us to find answer for this one

88. What is one of the most common use of Python's sys library?

Answer

Correct Answer: To capture command-line arguments given at a file's runtime

Note: This Question is unanswered, help us to find answer for this one

89. What built-in list method would you use to remove items from a list?

Answer

Correct Answer: .pop() method

Note: This Question is unanswered, help us to find answer for this one

90. What are attributes?

Answer

Correct Answer: Attributes are a way to hold data or describe a state for a class or an instance of a class.

Note: This Question is unanswered, help us to find answer for this one

91. What statement about static methods is true?

Answer

Correct Answer: Static methods serve mostly as utility methods or helper methods, since they can't access or modify a class's state.

Note: This Question is unanswered, help us to find answer for this one

92. What data structure does a binary tree degenerate to if it isn't balanced properly?

Answer

Correct Answer: Linked list

Note: This Question is unanswered, help us to find answer for this one

93. What happens when you use the build-in function any() on a list?

Answer

Correct Answer: The any() function returns True if any item in the list evaluates to True. Otherwise, it returns False.

Note: This Question is unanswered, help us to find answer for this one

94. What is an abstract class?

Answer

Correct Answer: An abstract class exists only so that other

Note: This Question is unanswered, help us to find answer for this one

95. The starting value of an algorithm used to generate a range of numbers is called the _________.

Answer

Correct Answer: Seed

Note: This Question is unanswered, help us to find answer for this one

96. The class ____ is the base of the classes designed to handle exceptions.

Answer

Correct Answer: Exception

Note: This Question is unanswered, help us to find answer for this one

97. A variable's ________ is the part of a program in which the variable may be accessed.

Answer

Correct Answer: Local

Note: This Question is unanswered, help us to find answer for this one

98. You usually use the for loop with ____ loops.

Answer

Correct Answer: Definite

Note: This Question is unanswered, help us to find answer for this one

99. When a function is called by its name, then it is _____.

Answer

Correct Answer: Executed

Note: This Question is unanswered, help us to find answer for this one

100. The purpose of the __________ is to get the first input value for the validation of a loop.

Answer

Correct Answer: Priming read

Note: This Question is unanswered, help us to find answer for this one

101. The _____ of a local variable is the function in which the variable is created

Answer

Correct Answer: Scope

Note: This Question is unanswered, help us to find answer for this one

102. It is recommended that programmers avoid using ________ variables in a program whenever possible.

Answer

Correct Answer: Global

Note: This Question is unanswered, help us to find answer for this one

103. If the start index is ________ the end index, the slicing expression will return an empty string.

Answer

Correct Answer: Greater than

Note: This Question is unanswered, help us to find answer for this one

104. An example of an attribute of an object might be _______.

Answer

Correct Answer: ​a social security number

Note: This Question is unanswered, help us to find answer for this one

105. All objects within a(n) _____ share common attributes and methods.

Answer

Correct Answer: Class

Note: This Question is unanswered, help us to find answer for this one

106. A(n) ________ access file is also known as a direct access file.

Answer

Correct Answer: Random

Note: This Question is unanswered, help us to find answer for this one

107. A series of nested if statements can also be called a ____ if statement.

Answer

Correct Answer: Cascading

Note: This Question is unanswered, help us to find answer for this one

108. The ________ design technique can be used to break down an algorithm into functions.

Answer

Correct Answer: Top-down

Note: This Question is unanswered, help us to find answer for this one

109. A condition is a ________ expression

Answer

Correct Answer: Boolean

Note: This Question is unanswered, help us to find answer for this one

110. To append data to an existing file, you open it with the ____________ method.

Answer

Correct Answer: File.AppendText

Note: This Question is unanswered, help us to find answer for this one

111. The process of ____ is used to create an object from a class.

Answer

Correct Answer: Constructor

Note: This Question is unanswered, help us to find answer for this one

112. A loop controlled by the user is a type of ____ loop.

Answer

Correct Answer: Incrementing

Note: This Question is unanswered, help us to find answer for this one

113. The function header begins with the keyword ____ followed by the name of the function.

Answer

Correct Answer: Def

Note: This Question is unanswered, help us to find answer for this one

114. Python comes with ________ functions that have been already prewritten for the programmer.

Answer

Correct Answer: Standard

Note: This Question is unanswered, help us to find answer for this one

115. Which two of the following dictionary objects return "0" on success and "-1" on failure?

Answer

Correct Answer: int PyDict_SetItem(PyObject *p, PyObject *key, PyObject *val)PyObject*
PyDict_GetItemWithError(PyObject *p, PyObject *key)
PyObject* PyDict_New()
int PyDict_DelItemString(PyObject *p, const char *key)

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

116. Which of the following options are the correct general socket methods?

Answer

Correct Answer: send()
socket.gethostname()

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

117. which two of the following interface objects cannot have child nodes? (Choose Two)

Answer

Correct Answer: ProcessingInstruction
Node

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

118. Which of the following statements about Python 3.4.2 is/are false?

Answer

Correct Answer: It is not an interpreted language.
It is not a case-sensitive language.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

119.

This question is based on the graphic shown below.



In the given image, which of the following line numbers in the Python code will result in a compilation error?

Answer

Correct Answer: Line number 15

Note: This Question is unanswered, help us to find answer for this one

120. Which of the following statements are correct?

Answer

Correct Answer: Lists in Python 3.4.2 are immutable.
Tuples in Python 3.4.2 are immutable

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

121.

In relation to the socket module in PythonoNetwork programming. which of the following options are the

correct parameters of the socket() function?


Answer

Correct Answer: E socket_type

Note: This Question is unanswered, help us to find answer for this one

122. Which of the given tuples are not used in the AF_INET6 address family?

Answer

Correct Answer: sockaddr

Note: This Question is unanswered, help us to find answer for this one

123. Which of the following modules are used with the FTP protocol in Python?

Answer

Correct Answer: ftplib
urllib

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

124.

In relation to the socket() function in Python, which of the following constants represent the socket

types?


1. SOCK_DGRAM


2. SOCK_RDM


3. SOCK_RAW


4. SOCK_SEQPACKET


Answer

Correct Answer: All options 1. 2. 3. and 4.

Note: This Question is unanswered, help us to find answer for this one

125.

What will be the correct output of the following Python language code?

import threading

def p_c(num):

print("[}".format(num ‘ num ‘ num))

def p_s(num):

print("[}".format(num ’ num))

if _name_ = "_main_":

t1 = threading.Thread(target=p_s. args=l10.))

t2 = threading.Thread(target=p_c, args=(10,))

t1.start()

t2.start0

11.join0

t2.join()

prinl("1")


Answer

Correct Answer: 100 1000 1

Note: This Question is unanswered, help us to find answer for this one

126.

Choose the correct output of the Python 3.4 code that is given in the image?

Answer

Correct Answer: Two 0.0 -0x2a

Note: This Question is unanswered, help us to find answer for this one

127.

Find the output of the following Python code and choose the correct answer from the given options.

class Son:

def __init_(self. n):

self‌in = n

print(self.n)

def sayh(self):

print(self.n)

p = Son('0') p-sayho

Answer

Correct Answer: o 0

Note: This Question is unanswered, help us to find answer for this one

128.

Choose the correct output of the given Python code.

Answer

Correct Answer: [36.0, 40.0, 52.0, 72.0, 100.0,136.0,180.0, 232.0] 266.5

Note: This Question is unanswered, help us to find answer for this one

129.

What will be the correct output of the following Python code?

lis1 =[2. 1. 3, 5]

lisZ = [6, 4, 3]

lis1.extend[lis2)

print (end=")

for i in range(0, len(lis1)):

print(end=" ")

lisl.clear()

print (end=")

for i in range(2. len(lis1)):

print(lisl[i]+1. end=" ")


Answer

Correct Answer: 2 13 5 5 4 3
4 2 61012 8 6
3 2 4 5 7 5 4

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

130.

What will be the correct output of the following Python code?

class Ba(object):

def _init_(se|f, x):

self‌ix = x+2

class De(Ba):

def _init_(self. x. y):

Bax = x‘2

self.y = y+2

def printXY(self):

print(Ba.x+2, self.y‘2)

d = De(10’2, 20+2)

d.printXYO


Answer

Correct Answer: 42 48

Note: This Question is unanswered, help us to find answer for this one

131.

Find the output of the following Python code and choose the correct answer from the given options.

class Ba(object):


pass

class De(Ba):


pass

print(issubclass(De. Ba))

print(issubclass(Ba, De))

d = 090

b = 880

print(isinstance(b, De))

print(isinstanceld. 88))


Answer

Correct Answer: True False False True

Note: This Question is unanswered, help us to find answer for this one

132. Which of the following shell expressions in Python 3.4 will give an error?

Answer

Correct Answer: >>> import unicodedata >>> unicodedata.decimal(9)

Note: This Question is unanswered, help us to find answer for this one

133. Which of the following options is not a method of xmlparser objects?

Answer

Correct Answer: Error-Handler

Note: This Question is unanswered, help us to find answer for this one

134.

What will be the correct output of the following Python code?

c = {"A”:1, "B":2}

print(c.get("A"))

print(c.get("C"))

print(c.get("C"."0"))