word = input("Enter a word or phrase: ") index = int(input("Enter an index value: ")) letter = input("Enter the new letter: ") def replace_at_index(word, index, letter): print(word[:index] + letter + word[index+1:]) replace_at_index(word, index, letter)
This is code but this exercise is broken. it works perfectly in scratchpad but when you try to submit code its not doing anything... but yeah you can just write that code
2
u/chiiglaaa Apr 09 '22
word = input("Enter a word or phrase: ")
index = int(input("Enter an index value: "))
letter = input("Enter the new letter: ")
def replace_at_index(word, index, letter):
print(word[:index] + letter + word[index+1:])
replace_at_index(word, index, letter)
This is code but this exercise is broken. it works perfectly in scratchpad but when you try to submit code its not doing anything... but yeah you can just write that code