Question: i need help fixing this python code Write code that produces a string made up of each character in a string variable named word separated
i need help fixing this python codeWrite code that produces a string made up of each character in a string variable named word separated by a dash. For example, if word contained the string 'Python', the resulting string would be 'P-y-t-h-o-n'. Do NOT include a dash after the last character. Store the resulting string in a variable named spell string. Assume that the variable word has already been initialized. 2 spell string - 3 for index in range (len(word)): if(index == len(word)-1): spell_string word[index] else: spell_string +- word[index]. "." print(spellstring) Check My Solution Load My Latest Solution Reset Test Results: You're using a variable named spell_string. X TypeError: String indices must be integers, not str on line 7 X TypeError: String indices must be integers, not str on line 7 X TypeError: String indices must be integers, not str on line 7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
