Report Bug
Qus :

What will be the output of the following Python code snippet?

print('abcdef12'.replace('cd', '12'))

Qus

निम्नलिखित Python कोड स्निपेट का आउटपुट क्या होगा?

print('abcdef12'.replace('cd', '12'))


A. ab12ef12
B. abcdef12
C. ab12efcd
D. none of the mentioned


Solution
A. ab12ef12



Explanation
All occurrences of the first substring are replaced by the second substring.



Report Bug