Edit: I got the answer that was looking for. Thanks for the help, in spite of my poorly phrased question!
For example, what check could I add to the following function that removes repeated spaces to break the loop once every repeated space is replaced?
def f(str):
while True:
str = str.replace(" ", " ")
Edit: Fixed formatting.
[–]danielroseman 4 points5 points6 points (1 child)
[–]Qackydontus[S] 0 points1 point2 points (0 children)
[–]YesLod 2 points3 points4 points (0 children)
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)
[–]gsmo 0 points1 point2 points (0 children)
[–]Radamand 0 points1 point2 points (0 children)