Questions

M.C.Q

🎯

Test yourself on this topic

21 questions · timed · auto-graded

MCQ 11 Mark
What is the output of the below program?

  • A
    3
  • B
    4
  • 4 is maximum
  • D
    None of the mentioned
Answer
Correct option: C.
4 is maximum
c
View full question & answer
MCQ 21 Mark
What will be the output? >>>test=”Hello World ” >>>test[6]='t' >>>print(test)
  • A
    Hello
  • B
    Hello torld
  • Error
  • D
    Hello World
Answer
Correct option: C.
Error
c
View full question & answer
MCQ 31 Mark
What will be the output? >>>d1 = {“Naveen ”:40, “Shailender ”:45} >>>“Naveen ”in d1
  • 1
  • B
    0
  • C
    None
  • D
    Error
Answer
Correct option: A.
1
a
View full question & answer
MCQ 41 Mark
What will be the output? >>>d1 = {“Naveen ”:40, “Shailender ”:45} >>>d2 = {“Naveen ”:466, “Shailender ”:45} >>>d1==d2
  • A
    1
  • 0
  • C
    None
  • D
    Error
Answer
Correct option: B.
0
b
View full question & answer
MCQ 51 Mark
What is the output of the following piece of code when executed in Python shell? >>>a=(5,6) >>>b=(9,8) >>>c=a+b >>>c
  • (5, 6, 9, 8)
  • B
    (14,14)
  • C
    Error as the tuples are immutable
  • D
    None
Answer
Correct option: A.
(5, 6, 9, 8)
a
View full question & answer
MCQ 61 Mark
What is the output of the following code? a= [1, 2, 3, 4, 5] for i in range(1, 5): a[i-1] = a[i] for i in range(0, 5): print(a[i],end = ““)
  • A
    5 5 1 2 3
  • B
    5 1 2 3 4
  • C
    2 3 4 5 1
  • 2 3 4 5 5
Answer
Correct option: D.
2 3 4 5 5
d
View full question & answer
MCQ 71 Mark
What is the output of the following code? a=[13,56,17] a.append([87]) a.extend([45,67]) print(a)
  • [13, 56, 17, [87], 45, 67].
  • B
    [13, 56, 17, 87, 45, 67].
  • C
    [13, 56, 17, 87,[ 45, 67]].
  • D
    [13, 56, 17, [87], [45, 67]].
Answer
Correct option: A.
[13, 56, 17, [87], 45, 67].
a
View full question & answer
MCQ 81 Mark
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])
  • all of the these
Answer
Correct option: D.
all of the these
d
View full question & answer
MCQ 91 Mark
Suppose listExample is ['h','e','l','l','o'], what is len(listExample)?
  • 5
  • B
    4
  • C
    None
  • D
    Error
Answer
Correct option: A.
5
a
View full question & answer
MCQ 101 Mark
Which of the following commands will create a list?
  • A
    list1 = list()
  • B
    list1 = [].
  • C
    list1 = list([1, 2, 3])
  • all of the these
Answer
Correct option: D.
all of the these
d
View full question & answer
MCQ 111 Mark
What is the output of the following? print('rachna sagar'.title())
  • A
    RACHNA SAGAR
  • Rachna Sagar
  • C
    Rachna sagar
  • D
    None of the above
Answer
Correct option: B.
Rachna Sagar
b
View full question & answer
MCQ 121 Mark
What is the output of the following?
print('RachnaSagar'.split('na', 2))
  • A
    ['Rach', 'naSagar']
  • ['Rach', 'Sagar']
  • C
    ['Rachna', 'Sagar']
  • D
    ['Rach','na', 'Sagar']
Answer
Correct option: B.
['Rach', 'Sagar']
b
View full question & answer
MCQ 131 Mark
In order to store values in terms of key and value which data type will you use?
  • A
    List
  • B
    Tuple
  • C
    Class
  • dictionary
Answer
Correct option: D.
dictionary
d
View full question & answer
MCQ 141 Mark
What data type is the object below ? L = [1, 23, 'hello', 1].
  • list
  • B
    dictionary
  • C
    array
  • D
    tuple
Answer
Correct option: A.
list
a
View full question & answer
MCQ 151 Mark
What will be the output of the given statements:
dict= {'Dhoni':7, 'Kohli':18, 'Sachin':10}
print(dict.keys())
  • A
    dict_keys(['Dhoni', 'Sachin'])
  • dict_keys(['Dhoni', 'Kohli', 'Sachin'])
  • C
    dict_values([7, 18, 10])
  • D
    dict_values([0,1,2])]
Answer
Correct option: B.
dict_keys(['Dhoni', 'Kohli', 'Sachin'])
b
View full question & answer
MCQ 211 Mark
OOP's Full form is:
  • A
    Object Based Oriented Language
  • Object Oriented Language
  • C
    Open Object Language
  • D
    Oriented Object Language
Answer
Correct option: B.
Object Oriented Language
b
View full question & answer
M.C.Q - Computer Science STD 12 Commerce Questions - Vidyadip