Returns a copy with occurrences of a substring replaced.
Syntax
str.replace(old, new, count?)Example
Enter values below to update the example in real time.
print→Hello→Python→World→text = "Hello World World"
print(text.replace("World", "Python"))
# Hello Python Python
# 최대 1번만 치환
print(text.replace("World", "Python", 1))
# Hello Python World