Home / CSE MCQs / Python MCQs :: Discussion

Discussion :: Python MCQs

  1. What is the output of the following?

    x = 'abcd'
    for i in range(len(x)):
        x[i].upper()
    print (x)
  2. A.
    abcd
    B.
    ABCD
    C.
    error
    D.
    none of the mentioned

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Changes do not happen in-place, rather a new instance of the string is returned.


Be The First To Comment