Skip to content

Instantly share code, notes, and snippets.

@DuncantheeDuncan
Created September 11, 2019 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DuncantheeDuncan/f1eb5abd5974f2a72c706360a8878c5f to your computer and use it in GitHub Desktop.
Save DuncantheeDuncan/f1eb5abd5974f2a72c706360a8878c5f to your computer and use it in GitHub Desktop.
# this program takes a string to be replaced
# by another string in ceratina char(index)
# and return the new string/ word.
words = raw_input("enter a name:")
print words
replace = raw_input("Enter word to replace:")
if replace in words:
i = words.replace(replace,"&&&&");
print i
else:
print 'Hint: - refer to built-in functions for strings.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment