Home / CSE MCQs / Python MCQs :: Discussion

Discussion :: Python MCQs

  1. The output of the code shown below is:

    s='{0}, {1}, and {2}'
    s.format('hello', 'good', 'morning')
  2. A.
    'hello good and morning'
    B.
    'hello, good, morning'
    C.
    'hello, good, and morning'
    D.
    Error

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    Within the subject string, curly braces designate substitution targets and arguments to be inserted either by position or keyword. Hence the output of the code shown above:'hello, good,and morning'.


Be The First To Comment