Variable and Comment in Python MCQs Exercise I


Ques 1 Variable and Comment


What is the output of the following code in Python?


var='Small Code'
print(var)

  a) Error
  b) SmallCode
  c) We Cannot initialize
  d) None of the above


b is the correct option





Ques 2 Variable and Comment


What is the output of the following Python Code?


name = "SmallCode"
def change():
   name = "SCode"
change()
print(name)

  a) SmallCode SCode
  b) SmallCode
  c) SCode
  d) Error : name is not defined


b is the correct option