Sail E0 Webinar
Question
What is the output of the following?print('xyyxyyxyxyxxy'.replace('xy', '12', 100))
Options:
A .  xyyxyyxyxyxxy
B .  12y12y1212x12
C .  none of the mentioned
D .  error
Answer: Option B


The first 100 occurences of the given substring are replaced.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers