I\'m currently learning Python as I\'m taking a data mining class. I was making a for-loop to make a noisy data file to do smoothing and I found a peculiarity on Python for-
There are two main problems with the python I see;
Firstly the for loop does not work in the same way as the cpp for loop: python will reset i to go through the range, what you did with i inside the previous loops will be lost. Secondly python does not have a termination char on its strings like cpp does:
input = "abc defg"
eachWord = ''
i = 0
while(i < len(input)):
print("At the first part of the loop, i = ", i, ".")
while(i < len(input) and input[i] != ' '):
eachWord += input[i]
i += 1
print(eachWord)
print("At the last part of the loop, i = ", i, ".")
print()
eachWord = ''
i += 1