Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python code snippet?
print(‘xyyxyyxyxyxxy’.replace(‘xy’, ’12’, 100))

What will be the output of the following Python code snippet?
print(‘xyyxyyxyxyxxy’.replace(‘xy’, ’12’, 100))
a) xyyxyyxyxyxxy
b) 12y12y1212x12
c) none of the mentioned
d) Error

Answer: b
Explanation: The first 100 occurrences of the given substring are replaced.

Join The Discussion