More MCQs
1.

Which of the following expressions can be used to multiply a given number ‘a’ by 4?

A. a<<2
B. a<<4
C. a>>2
D. a>>4
Answer» A. a<<2
Explanation: let us consider an example wherein a=2. the binary form of 2 is 0010. when we left shift this value by 2, we get 1000, the value of which is 8. hence if we want to multiply a given number ‘a’ by 4, we can use the expression: a<<2.
2.

R operator. Hence the output of the code shown above is: 20 10.

A. 1011011
B. 11010100
C. 11101011
D. 10110011
Answer» B. 11010100
Explanation: the binary form of -44 is 00101100. the one’s complement of this value is 11010011. on adding one to this we get: 11010100 (two’s complement).
3.

What will be the output of the following
Python code snippet?
not(10<20) and not(10>30)

A. true
B. false
C. error
D. no output
Answer» B. false
Explanation: the expression not(10<20) returns false. the expression not(10>30) returns true. the and operation between false and true returns false. hence the output is false.
4.

What will be the output of the following
Python code?
for i in range(0):
print(i)

A. 0
B. no output
C. error
D. none of the mentioned
Answer» B. no output
Explanation: range(0) is empty.
5.

What will be the output of the following
Python code?
for i in range(2.0):
print(i)

A. 0.0 1.0
B. 0 1
C. error
D. none of the mentioned
Answer» C. error
Explanation: object of type float cannot be interpreted as an integer.
6.

What will be the output of the following
Python code?
for i in range(int(2.0)):
print(i)

A. 0.0 1.0
B. 0 1
C. error
D. none of the mentioned
Answer» B. 0 1
Explanation: range(int(2.0)) is the same as range(2).
7.

What will be the output of the following
Python code snippet?
a = [0, 1, 2, 3]
for a[0] in a:
print(a[0])

A. 0 1 2 3
B. 0 1 2 2
C. 3 3 3 3
D. error
Answer» A. 0 1 2 3
Explanation: the value of a[0] changes in each iteration. since the first value that it takes is itself, there is no visible error in the current example.
8.

What will be the output of the following
Python statement?
>>>"a"+"bc"

A. a
B. bc
C. bca
D. abc
Answer» D. abc
Explanation: + operator is concatenation operator.
9.

What will be the output of the following
Python statement?
>>>"abcd"[2:]

A. a
B. ab
C. cd
D. dc
Answer» C. cd
Explanation: slice operation is performed on string.
10.

What will be the output of the following
Python code?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]

A. olleh
B. hello
C. h
D. o
Answer» D. o
Explanation: -1 corresponds to the last index.
11.

What arithmetic operators cannot be used with strings?

A. +
B. *
C.
D. all of the mentioned
Answer» C. –
Explanation: + is used to concatenate and * is used to multiply strings.
12.

What will be the output of the following Python code? >>>print (r"\nhello")

A. a new line and hello
B. \\nhello
C. the letter r and then hello
D. error
Answer» B. \\nhello
Explanation: when prefixed with the letter ‘r’ or ‘r’ a string literal becomes a raw string and the escape sequences such as \n are not converted.
13.

What will be the output of the following Python code? >>>print('new' 'line')

A. error
B. output equivalent to print ‘new\\nline’
C. newline
D. new line
Answer» C. newline
Explanation: string literal separated by whitespace are allowed. they are concatenated.
14.

What will be the output of the following
Python code?
1. >>>str1="helloworld"
2. >>>str1[::-1]

A. dlrowolleh
B. hello
C. world
D. helloworld
Answer» A. dlrowolleh
Explanation: execute in shell to verify.
15.

What will be the output of the following
Python code?
print(0xA + 0xB + 0xC)

A. 0xa0xb0xc
B. error
C. 0x22
D. 33
Answer» D. 33
Explanation: 0xa and 0xb and 0xc are hexadecimal integer literals representing the decimal values 10, 11 and 12 respectively. there sum is 33.
16.

What will be the output of the following
Python code?
1. class father:
2. def __init__(self, param):
3. self.o1 = param
4.
5. class child(father):
6. def __init__(self, param):
7. self.o2 = param
8.
9. >>>obj = child(22)
10. >>>print "%d %d" % (obj.o1, obj.o2)

A. none none
B. none 22
C. 22 none
D. error is generated
Answer» D. error is generated
Explanation: self.o1 was never created.
17.

What will be the output of the following
Python code?
1. class tester:
2. def __init__(self, id):
3. self.id = str(id)
4. id="224"
5.
6. >>>temp = tester(12)
7. >>>print(temp.id)

A. 224
B. error
C. 12
D. none
Answer» C. 12
Explanation: id in this case will be the attribute of the class.
18.

3. What will be the output of the following
Python code?
1. >>>example = "snow world"
2. >>>print("%s" % example[4:7])

A. wo
B. world
C. sn
D. rl
Answer» A. wo
Explanation: execute in the shell and verify.
19.

What will be the output of the following
Python code?
1. >>>example = "snow world"
2. >>>example[3] = 's'
3. >>>print example

A. snow
B. snow world
C. error
D. snos world
Answer» C. error
Explanation: strings cannot be modified.
20.

>>>max("what are you")

A. error
B. u
C. t
D. y
Answer» D. y
Explanation: max returns the character with the highest ascii value.
21.

Given a string example=”hello” what is the output of example.count(‘l’)?

A. 2
B. 1
C. none
D. 0
Answer» A. 2
Explanation: l occurs twice in hello.
22.

>>>example.find("e")

A. error
B. -1
C. 1
D. 0
Answer» C. 1
Explanation: returns lowest index.
23.

>>>example.rfind("e")

A. -1
B. 4
C. 3
D. 1
Answer» B. 4
Explanation: returns highest index.
24.

>>>example[::-1].startswith("d")

A. dlrowolleh
B. true
C. -1
D. none
Answer» B. true
Explanation: starts with checks if the given string starts with the parameter that is passed.
25.

To concatenate two strings to a third what statements are applicable?

A. s3 = s1 . s2
B. s3 = s1.add(s2)
C. s3 = s1.    add    (s2)
D. s3 = s1 * s2
Answer» C. s3 = s1.    add    (s2)
Explanation:     add     is another method that can be used for concatenation.
26.

>>>chr(ord('A'))

A. a
B. b
C. a
D. error
Answer» A. a
Explanation: execute in shell to verify.
27.

>>>print(chr(ord('b')+1))

A. a
B. b
C. c
D. a
Answer» C. c
Explanation: execute in the shell to verify.
28.

Which of the following statement prints hello\example\test.txt?

A. print(“hello\\example\\test.txt”)
B. print(“hello\\example\\test.txt”)
C. print(“hello\\”example\\”test.txt”)
D. print(“hello”\\example”\\test.txt”)
Answer» B. print(“hello\\example\\test.txt”)
Explanation: \is used to indicate that the next
29.

Suppose s is “\t\tWorld\n”, what is s.strip()?

A. \\t\\tworld\\n
B. \\t\\tworld\\n
C. \\t\\tworld\\n
D. world
Answer» D. world
Explanation: execute help(string.strip) to find details.
30.

The format function, when applied on a string returns                        

A. error
B. int
C. bool
D. str
Answer» D. str
Explanation: format function returns a string.
31.

+2+3?

A. hello123
B. hello
C. error
D. hello6
Answer» C. error
Explanation: cannot concatenate str and int objects.
32.

>>>print("A", end = ' ')

A. dcba
B. a, b, c, d
C. d c b a
D. d, c, b, a will be displayed on four lines
Answer» C. d c b a
Explanation: execute in the shell.
33.

What will be displayed by print(ord(‘b’) – ord(‘a’))?

A. 0
B. 1
C. -1
D. 2
Answer» B. 1
Explanation: ascii value of b is one more than a. hence the output of this code is 98-97, which is equal to 1.
34.

Say s=”hello” what will be the return value of type(s)?

A. int
B. bool
C. str
D. string
Answer» C. str
Explanation: str is used to represent strings in python.
35.

What is “Hello”.replace(“l”, “e”)?

A. heeeo
B. heelo
C. heleo
D. none
Answer» A. heeeo
Explanation: execute in shell to verify.
36.

To retrieve the character at index 3 from string s=”Hello” what command do we execute (multiple answers allowed)?

A. s[]
B. s.getitem(3)
C. s.    getitem    (3)
D. s.getitem(3)
Answer» C. s.    getitem    (3)
Explanation:     getitem(..) can be used to get character at index specified as parameter.
37.

To return the length of string s what command do we execute?

A. s.    len    ()
B. len(s)
C. size(s)
D. s.size()
Answer» A. s.    len    ()
Explanation: execute in shell to verify.
38.

If a class defines the     str    (self) method, for an object obj for the class, you can use which command to invoke the     str      method.

A. obj.    str    ()
B. str(obj)
C. print obj
D. all of the mentioned
Answer» D. all of the mentioned
Explanation: execute in shell to verify.
39.

To check whether string s1 contains another string s2, use                  

A. s1.    contains    (s2)
B. s2 in s1
C. s1.contains(s2)
D. si.in(s2)
Answer» A. s1.    contains    (s2)
Explanation: s2 in s1 works in the same way as calling the special function     contains     .
40.

Suppose i is 5 and j is 4, i + j is same as

A. i.    add(j)
B. i.    add    (j)
C. i.    add(j)
D. i.    add(j)
Answer» B. i.    add    (j)
Explanation: execute in shell to verify.
41.

What function do you use to read a string?

A. input(“enter a string”)
B. eval(input(“enter a string”))
C. enter(“enter a string”)
D. eval(enter(“enter a string”))
Answer» A. input(“enter a string”)
Explanation: execute in shell to verify.
42.

What is the default value of encoding in encode()?

A. ascii
B. qwerty
C. utf-8
D. utf-16
Answer» C. utf-8
Explanation: the default value of encoding is utf-8.
43.

Which of the following functions is a built- in function in python?

A. seed()
B. sqrt()
C. factorial()
D. print()
Answer» D. print()
Explanation: the function seed is a function which is present in the random module. the functions sqrt and factorial are a part of the math module. the print function is a built-in function which prints a value directly to the system output.
44.

What is the output of the function complex()?

A. 0j
B. 0+0j
C. 0
D. error
Answer» A. 0j
Explanation: the complex function returns 0j if both of the arguments are omitted, that is, if the function is in the form of complex() or complex(0), then the output will be 0j.
45.

The function divmod(a,b), where both ‘a’ and ‘b’ are integers is evaluated as:

A. (a%b, a//b)
B. (a//b, a%b)
C. (a//b, a*b)
D. (a/b, a%b)
Answer» B. (a//b, a%b)
Explanation: the function divmod(a,b) is evaluated as a//b, a%b, if both ‘a’ and ‘b’ are integers.
46.

The function complex(‘2-3j’) is valid but the function complex(‘2 – 3j’) is invalid.

A. true
B. false
Answer» A. true
Explanation: when converting from a string, the string must not contain any blank spaces around the + or – operator. hence the function complex(‘2 – 3j’) will result in an error.
47.

Which of the following functions does not necessarily accept only iterables as arguments?

A. enumerate()
B. all()
C. chr()
D. max()
Answer» C. chr()
Explanation: the functions enumerate(), all() and max() accept iterables as arguments whereas the function chr() throws an error on receiving an iterable as an argument. also note that the function chr() accepts only integer values.
48.

Which of the following functions accepts only integers as arguments?

A. ord()
B. min()
C. chr()
D. any()
Answer» C. chr()
Explanation: the function chr() accepts only integers as arguments. the function ord() accepts only strings. the functions min() and max() can accept floating point as well as integer arguments.
49.

Suppose there is a list such that: l=[2,3,4]. If we want to print this list in reverse order, which of the following methods should be used?

A. reverse(l)
B. list(reverse[(l)])
C. reversed(l)
D. list(reversed(l))
Answer» D. list(reversed(l))
Explanation: the built-in function reversed() can be used to reverse the elements of a list. this function accepts only an iterable as an argument. to print the output in the form of a list, we use: list(reversed(l)). the output will be: [4,3,2].
50.

Which of the following functions will not result in an error when no arguments are passed to it?

A. min()
B. divmod()
C. all()
D. float()
Answer» D. float()
Explanation: the built-in functions min(), max(), divmod(), ord(), any(), all() etc throw an error when no arguments are passed to them. however there are some built-in functions like float(), complex() etc which do not throw an error when no arguments are passed to them. the output of float() is 0.0.
51.

Which of the following functions does not throw an error?

A. ord()
B. ord(‘ ‘)
C. ord(”)
D. ord(“”)
Answer» B. ord(‘ ‘)
Explanation: the function ord() accepts a character. hence ord(), ord(”) and ord(“”)
52.

Which of the following is the use of function in python?

A. functions are reusable pieces of programs
B. functions don’t provide better modularity for your application
C. you can’t also create your own functions
D. all of the mentioned
Answer» A. functions are reusable pieces of programs
Explanation: functions are reusable pieces of programs. they allow you to give a name to a block of statements, allowing you to run that block using the specified name anywhere in your program and any number of times.
53.

printMax(3, 4)

A. 3
B. 4
C. 4 is maximum
D. none of the mentioned
Answer» C. 4 is maximum
Explanation: here, we define a function called printmax that uses two parameters called a and b. we find out the greater number using a simple if..else statement and then print the bigger number.
54.

print(maximum(2, 3))

A. 2
B. 3
C. the numbers are equal
D. none of the mentioned
Answer» B. 3
Explanation: the maximum function returns the maximum of the parameters, in this case the numbers supplied to the function. it uses a simple if..else statement to find the greater value and then returns that value.
55.

Which of the following is a feature of DocString?

A. provide a convenient way of associating documentation with python modules, functions, classes, and methods
B. all functions should have a docstring
C. docstrings can be accessed by the     doc      attribute on objects
D. all of the mentioned
Answer» D. all of the mentioned
Explanation: python has a nifty feature called documentation strings, usually referred to by its shorter name docstrings. docstrings
56.

What are the two main types of functions?

A. custom function
B. built-in function & user defined function
C. user function
D. system function
Answer» B. built-in function & user defined function
Explanation: built-in functions and user defined ones. the built-in functions are part of the python language. examples are: dir(), len() or abs(). the user defined functions are functions created with the def keyword.
57.

Where is function defined?

A. module
B. class
C. another function
D. all of the mentioned
Answer» D. all of the mentioned
Explanation: functions can be defined inside a module, a class or another function.
58.

Which of the following is the use of id() function in python?

A. id returns the identity of the object
B. every object doesn’t have a unique id
C. all of the mentioned
D. none of the mentioned
Answer» A. id returns the identity of the object
Explanation: each object in python has a unique id. the id() function returns the object’s id.
59.

Which of the following refers to mathematical function?

A. sqrt
B. rhombus
C. add
D. rhombus
Answer» A. sqrt
Explanation: functions that are always available for usage, functions that are contained within external modules, which must be imported and functions defined by a programmer with the def keyword.
60.

print x

A. 9
B. 3
C. 27
D. 30
Answer» C. 27
Explanation: a function is created to do a specific task. often there is a result from such a task. the return keyword is used to return
61.

Python supports the creation of anonymous functions at runtime, using a construct called

A. lambda
B. pi
C. anonymous
D. none of the mentioned
Answer» A. lambda
Explanation: python supports the creation of anonymous functions (i.e. functions that are not bound to a name) at runtime, using a construct called lambda. lambda functions are restricted to a single expression. they can be used wherever normal functions can be used.
62.

print z(8)

A. 48
B. 14
C. 64
D. none of the mentioned
Answer» A. 48
Explanation: the lambda keyword creates an anonymous function. the x is a parameter, that is passed to the lambda function. the parameter is followed by a colon character.
63.

Does Lambda contains return statements?

A. true
B. false
Answer» B. false
Explanation: lambda definition does not include a return statement. it always contains an expression which is returned. also note that we can put a lambda definition anywhere a function is expected. we don’t have to assign it to a variable at all.
64.

Lambda is a statement.

A. true
B. false
Answer» B. false
Explanation: lambda is an anonymous function in python. hence this statement is false.
65.

What is a variable defined outside a function referred to as?

A. a static variable
B. a global variable
C. a local variable
D. an automatic variable
Answer» B. a global variable
Explanation: the value of a variable defined outside all function definitions is referred to as a global variable and can be used by multiple functions of the program.
66.

What is a variable defined inside a function referred to as?

A. a global variable
B. a volatile variable
C. a local variable
D. an automatic variable
Answer» C. a local variable
Explanation: the variable inside a function is called as local variable and the variable definition is confined only to that function.
67.

If a function doesn’t have a return statement, which of the following does the function return?

A. int
B. null
C. none
D. an exception is thrown without the return statement
Answer» C. none
Explanation: a function can exist without a return statement and returns none if the function doesn’t have a return statement.
68.

What is the type of each element in sys.argv?

A. set
B. list
C. tuple
D. string
Answer» D. string
Explanation: it is a list of strings.
69.

What is the length of sys.argv?

A. number of arguments
B. number of arguments + 1
C. number of arguments – 1
D. none of the mentioned
Answer» B. number of arguments + 1
Explanation: the first argument is the name of the program itself. therefore the length of sys.argv is one more than the number arguments.
70.

How many keyword arguments can be passed to a function in a single function call?

A. zero
B. one
C. zero or more
D. one or more
Answer» C. zero or more
Explanation: zero keyword arguments may be passed if all the arguments have default values.
71.

Which module in the python standard library parses options received from the command line?

A. getopt
B. os
C. getarg
D. main
Answer» A. getopt
Explanation: getopt parses options received from the command line.
72.

What is the type of sys.argv?

A. set
B. list
C. tuple
D. string
Answer» B. list
Explanation: it is a list of elements.
73.

Which of the following data structures is returned by the functions globals() and locals()?

A. list
B. set
C. dictionary
D. tuple
Answer» C. dictionary
Explanation: both the functions, that is, globals() and locals() return value of the data structure dictionary.
74.

On assigning a value to a variable inside a function, it automatically becomes a global variable.

A. true
B. false
Answer» B. false
Explanation: on assigning a value to a variable inside a function, t automatically becomes a local variable. hence the above statement is false.
75.

What happens if a local variable exists with the same name as the global variable you want to access?

A. error
B. the local variable is shadowed
C. undefined behavior
D. the global variable is shadowed
Answer» D. the global variable is shadowed
Explanation: if a local variable exists with the same name as the local variable that you want to access, then the global variable is shadowed. that is, preference is given to the local variable.
76.

Which is the most appropriate definition for recursion?

A. a function that calls itself
B. a function execution instance that calls another execution instance of the same function
C. a class method that calls another class method
D. an in-built method that is automatically called
Answer» B. a function execution instance that calls another execution instance of the same function
Explanation: the appropriate definition for a recursive function is a function execution instance that calls another execution instance of the same function either directly or indirectly.
77.

Only problems that are recursively defined can be solved using recursion.

A. true
B. false
Answer» B. false
Explanation: there are many other problems can also be solved using recursion.
78.

Which of these is false about recursion?

A. recursive function can be replaced by a non-recursive function
B. recursive functions usually take more memory space than non-recursive function
C. recursive functions run faster than non- recursive function
D. recursion makes programs easier to understand
Answer» C. recursive functions run faster than non- recursive function
Explanation: the speed of a program using recursion is slower than the speed of its non- recursive equivalent.
79.

What is tail recursion?

A. a recursive function that has two base cases
B. a function where the recursive functions leads to an infinite loop
C. a recursive function where the function doesn’t return anything and just prints the values
D. a function where the recursive call is the last thing executed by the function
Answer» D. a function where the recursive call is the last thing executed by the function
Explanation: a recursive function is tail recursive when recursive call is executed by the function in the last.
80.

Which of the following statements is false about recursion?

A. every recursive function must have a base case
B. infinite recursion can occur if the base case isn’t properly mentioned
C. a recursive function makes the code easier to understand
D. every recursive function must have a return value
Answer» D. every recursive function must have a return value
Explanation: a recursive function needn’t have a return value.
81.

Recursion and iteration are the same programming approach.

A. true
B. false
Answer» B. false
Explanation: in recursion, the function calls itself till the base condition is reached whereas iteration means repetition of process for example in for-loops.
82.

What happens if the base condition isn’t defined in recursive programs?

A. program gets into an infinite loop
B. program runs once
C. program runs n number of times where n is the argument given to the function
D. an exception is thrown
Answer» A. program gets into an infinite loop
Explanation: the program will run until the system gets out of memory.
83.

Which of these is not true about recursion?

A. making the code look clean
B. a complex task can be broken into sub- problems
C. recursive calls take up less memory
D. sequence generation is easier than a nested iteration
Answer» C. recursive calls take up less memory
Explanation: recursive calls take up a lot of memory and time as memory is taken up each time the function is called.
84.

Which of these is not true about recursion?

A. it’s easier to code some real-world problems using recursion than non-recursive equivalent
B. recursive functions are easy to debug
C. recursive calls take up a lot of memory
D. programs using recursion take longer time than their non-recursive equivalent
Answer» B. recursive functions are easy to debug
Explanation: recursive functions may be hard to debug as the logic behind recursion may be hard to follow.
85.

Which of the following commands will create a list?

A. list1 = list()
B. list1 = []
C. list1 = list([1, 2, 3])
D. all of the mentioned
Answer» D. all of the mentioned
Explanation: execute in the shell to verify
86.

What is the output when we execute list(“hello”)?

A. [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
B. [‘hello’]
C. [‘llo’]
D. [‘olleh’]
Answer» A. [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
Explanation: execute in the shell to verify.
87.

Suppose list1 is [2445,133,12454,123], what is max(list1)?

A. 2445
B. 133
C. 12454
D. 123
Answer» C. 12454
Explanation: max returns the maximum element in the list.
88.

Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)?

A. 3
B. 5
C. 25
D. 1
Answer» D. 1
Explanation: min returns the minimum element in the list.
89.

Suppose list1 is [1, 5, 9], what is sum(list1)?

A. 1
B. 9
C. 15
D. error
Answer» C. 15
Explanation: sum returns the sum of all elements in the list.
90.

To shuffle the list(say list1) what function do we use?

A. list1.shuffle()
B. shuffle(list1)
C. random.shuffle(list1)
D. random.shufflelist(list1)
Answer» C. random.shuffle(list1)
Explanation: execute in the shell to verify.
91.

Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?

A. print(list1[0])
B. print(list1[:2])
C. print(list1[:-2])
D. all of the mentioned
Answer» D. all of the mentioned
Explanation: slicing is allowed in lists just as in the case of strings.
92.

Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?

A. error
B. none
C. 25
D. 2
Answer» C. 25
Explanation: -1 corresponds to the last index in the list.
93.

Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?

A. [2, 33, 222, 14]
B. error
C. 25
D. [25, 14, 222, 33, 2]
Answer» A. [2, 33, 222, 14]
Explanation: execute in the shell to verify.
94.

print sum

A. 11
B. 12
C. 21
D. 22
Answer» B. 12
Explanation: when assigning names1 to names2, we create a second reference to the same list. changes to names2 affect names1. when assigning the slice of all elements in names1 to names3, we are creating a full copy of names1 which can be modified independently.
95.

Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is:

A. [0, 1, 2, 3]
B. [0, 1, 2, 3, 4]
C. [0.0, 0.5, 1.0, 1.5]
D. [0.0, 0.5, 1.0, 1.5, 2.0]
Answer» C. [0.0, 0.5, 1.0, 1.5]
Explanation: execute in the shell to verify.
96.

To add a new element to a list we use which command?

A. list1.add(5)
B. list1.append(5)
C. list1.addlast(5)
D. list1.addend(5)
Answer» B. list1.append(5)
Explanation: we use the function append to add an element to the list.
97.

To insert 5 to the third position in list1, we use which command?

A. list1.insert(3, 5)
B. list1.insert(2, 5)
C. list1.add(3, 5)
D. list1.append(3, 5)
Answer» B. list1.insert(2, 5)
Explanation: execute in the shell to verify.
98.

To remove string “hello” from list1, we use which command?

A. list1.remove(“hello”)
B. list1.remove(hello)
C. list1.removeall(“hello”)
D. list1.removeone(“hello”)
Answer» A. list1.remove(“hello”)
Explanation: execute in the shell to verify.
99.

Suppose list1 is [3, 4, 5, 20, 5], what is list1.index(5)?

A. 0
B. 1
C. 4
D. 2
Answer» D. 2
Explanation: execute help(list.index) to get details.
100.

Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1.count(5)?

A. 0
B. 4
C. 1
D. 2
Answer» D. 2
Explanation: execute in the shell to verify.
Tags
Question and answers in more mcqs, more mcqs multiple choice questions and answers, more mcqs Important MCQs, Solved MCQs for more mcqs, more mcqs MCQs with answers PDF download