def changeLetters(myString, origLtr, repLtr): newString = "" for i in myString: if i == origLtr: newString = newString + repLtr else: newString = newString + i return newString string = "Some of the earliest evidence of advanced tool use includes remnants of an early type of dart, which can be considered the ancestor of arrows as well as bows (see Operation). Reconstructions of this system have a range of over one hundred metres (yards) and can penetrate several centimetres of oak." x = changeLetters(string, "d", "f") print x
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question