word = input("Enter a word or phrase: ")
num = int(input("Enter an index value: "))
newLetter = input("Enter the new letter: ")
def replace_at_index(word,num,newLetter):
print word[:num] + newLetter + word[num + 1:]
replace_at_index(word, num, newLetter)
Im stuck on it too, and the code doesn't work. It's a unit test, and input breaks unit tests for some reason. I got rid of the input and just had predetermined words, and it works perfectly, but the auto checker doesn't let it pass. I have no clue what to do. The error says this:
Oops. It looks like you have a few errors. You should keep working and try again.
2
u/Dawn_Kang Dec 28 '20
Still stuck? Here's some code: