It keeps saying expected an indented block right after the first ' ' but the thing is, an hour before this code worked perfectly fine and now it's getting this error for some reason
any time I try to modify near that area it keeps making me change it to a function within python instead of the variable I want to use or compare it to
def reduceWhitespace(S):
"""
Takes string value and returns with all extra spaces taken out between words
"""
hold = S[0]
for i in range(len(S)-1):
if S[i] == ' ' and S[i+1] == ' ' :
continue
hold += S[i+1]
return(hold)
All it needs to do is check for extra spaces in a string and spit out the result without all the spaces minus one so that a sentence looks like a sentence
Updated for entire code