On Fri, 1 Sep 2017 11:30 pm, SS wrote: > Check out the following simple code: [...]
Did you read the documentation for the `input` function? In Python 2, `input` should be avoided, because it evaluates whatever the user types. Watch this: py> answer = input('type a number ') type a number 'abcdefg'.find('e') py> print answer 4 What you should use is `raw_input`, but remember that it returns a string, not a number, so if you want a number you have to call int() on the results. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailman/listinfo/python-list