Home / CSE MCQs / Python MCQs :: Discussion

Discussion :: Python MCQs

  1. What is the output of the code shown below?

    'The {} side {1} {2}'.format('bright', 'of', 'life')
  2. A.
    Error
    B.
    'The bright side of life'
    C.
    'The {bright} side {of} {life}'
    D.
    No output

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    The code shown above results in an error. This is because we have switched from automatic field numbering to manual field numbering, that is, from {} to {1}. Hence this code results in an error.


Be The First To Comment