in this article we'll how to replace character in string one time by usisg replace()function

syntax

1
string.replace(old, new, maxreplace)

example 1 : replace "h" with "c" one time

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#string
string = "hello python"

#replace "h" with "c"
string = string.replace("h", "c", 1)

#print
print(string)

# p = old, c = new, 1 = one time

output

cello python

English today is not an art to be mastered it's just a tool to use to get a result