Home / CSE MCQs / Python MCQs :: Discussion

Discussion :: Python MCQs

  1. What is the output of the following?

    print('xyyxyyxyxyxxy'.replace('xy', '12', 100))
  2. A.
    xyyxyyxyxyxxy
    B.
    12y12y1212x12
    C.
    none of the mentioned
    D.
    error

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    The first 100 occurences of the given substring are replaced.


Be The First To Comment