x=x-1 does not work after input() -- string has to be converted to a number
Asked by
dustin
I am having trouble with simple math in a while loop. The program refuses to perform the subtraction and continue the loop. Here is the response:
[error] Error message: Traceback (most recent call last):
File "C:\Users\
x=x-1
TypeError: unsupported operand type(s) for -: 'unicode' and 'int'
x = input("How many times to type Hello?:")
if (x > 0):
type("Hello")
x=x-1
x=x-1 is the problem. Tried many varriations x=x-- ect so far nothing works.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- dustin
- Solved:
- Last query:
- Last reply:
To post a message you must log in.