Infinite loop in python | Beware of infinite loops - Codanics