Most Asked MCQ In Python

Hi… Welcome to programming fundamental.. One of the most popular language, Python In this blog we will see the most asked MCQ about the Python…

Q.1 What is the maximum possible length of an identifier?

  1. 16
  2. 32
  3. 64
  4. None of these above

Q.2 Who developed the Python language?

  1. Dennis M. Ritchie
  2. Guido van Rossum
  3. Niene Stom
  4. Wick van Rossum

 Q.3 Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

Q.4 Which character is used in Python to make a single line comment?

  1. /
  2. //
  3. #
  4. *

Q.5 Which character is used in Python to make a Multi- line comment?

  1. #
  2. */
  3. /*
  4. “‘ ”’

Q.6 Which of the following statements is correct for variable names in Python language?

  1. All variable names must begin with an underscore.
  2. Unlimited length
  3. The variable name that refers to a value variable point to the memory location where data is read and modified.
  4. All of the above

Q.7 Variable that are created outside the function is known as…..

  1. Constant variable
  2. Default variable
  3. Global variable
  4. Local variable

Q.8 Which of the following operators is the correct option for power(xy)?

  1. x ^ y
  2. x**y
  3. x ^ ^ y
  4. x ^ * y

Q.9 When User convert the data type of an object to required data type is called….

  1. Explicit type casting
  2. Implicit type casting
  3. Automatic type casting
  4. All above

Q.10 If we want to add two strings then … operator is used.

  1. _
  2. *
  3. &
  4. +

Q.11 What is Output of the following program.

import math

print (math.pi)

  1. math.pi
  2. π
  3. pi
  4. 3.141592653589793

Q.12 Which of the following functions is a built-in function in python language?

  1. val()
  2. scan()
  3. print()
  4. None of these

Q.13 Study the following statements:

>>> str1 = “Wikin”  

>>> str2 = “:”  

>>> str3 = “wow”  

>>> str1[-1:]  

What will be the output of this statement?

  1. Error
  2. w
  3. n
  4. None of above

Q.14 list are denoted by ….bracket.

  1. {}
  2. ()
  3. <>
  4. []

Q.15 Study the following statements:

list1=[‘a’,’b’,’c’,’d’]

list1.append([‘e’,’f’,’g’])

What will be the output of this statement?

  1. [‘a’,’b’,’c’,’d’,[‘e’,’f’,’g’]]
  2. [‘e’,’f’,’g’]
  3. [‘a’,’b’,’c’,’d’]
  4. [‘a’,’b’,’c’,’d’,’e’,’f’,’g’]

apppend() method add the element to the end of the list

Q.16 Study the following statements:

list2=[‘a’,’b’,’c’,’d’]

list2.extend([1,2,3,4,])

What will be the output of this statement?

  1. [‘a’,’b’,’c’,’d’,[1,2,3,4]]
  2. [1,2,3,4]
  3. [‘a’,’b’,’c’,’d’]
  4. [‘a’,’b’,’c’,’d’,1,2,3,4]

extend() method add the all element in single list.

Q.17 Study the following statements:

Data=[“C”,”C#”,”Java”,”PHP”]

Data.insert(2,”Python”)

What will be the output of this statement?

  1. [“C”,”C#”,”Java”,”PHP”]
  2. [“C”,”C#”,”Java”,”PHP”,”Python”]
  3. [“C”,”Python”,”C#”,”Java”,”PHP”]
  4. none above

insert () method add the element in given index

Q.18 Creating tuple without parenthes(Arguments) is callled…..

  1. Empty tuple
  2. Tuple Packing
  3. Nested tuple
  4. Mixed Tuple

Q.19—— bracket are used to tuples.

  1. {}
  2. ()
  3. <>
  4. []

Q.20 What is data type of the following program.

Days={“Sunday”,”Monday”,”Tuesday”,”Wednesday”}

print(type(Days))

  1. string
  2. Char
  3. <class_ list>
  4. <class_ set>

Q.21 Study the following statements:

num={1,2,3,4,,5,6}

num.pop()

print(num)

What will be the output of this statement?

  1. 1
  2. 6
  3. 3
  4. error

POP() function remove last element of the set.

Leave a Reply

Your email address will not be published. Required fields are marked *