From where is the value of i coming? Push [code] button before pasting your code.
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
Use only position, consider when the last line should be executed.
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
You are only accepting space among four first letters (range(4), and i is always zero whem checking for space. Alsothe while loop does not terminate because i does not increase.
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
Remove the line 7 and think again the while condition considering that length of string is never negative. Add more print statements for debuging.
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852