+ 1

Replace

g = "hi" g.replace("i","h") print (g) How to replace it ? šŸ¤”

9th Mar 2022, 4:08 PM
Shaishab Chandra Shil
Shaishab Chandra Shil - avatar
3 Answers
+ 3
g = "hi" g=g.replace("i","h") print(g)
9th Mar 2022, 4:13 PM
Jayakrishna šŸ‡®šŸ‡³
+ 2
Do you want its meaning.. ? g.replace("i", "h") replaces i with h so g="hh" and next ("hh").replace("h","i") replaces h with i so output g = "ii"
9th Mar 2022, 4:56 PM
Jayakrishna šŸ‡®šŸ‡³
+ 1
JayakrishnašŸ‡®šŸ‡³ and 2 replace ? g = g.replace("i","h").replace ("h","i")
9th Mar 2022, 4:19 PM
Shaishab Chandra Shil
Shaishab Chandra Shil - avatar