Jun-16-2018, 07:06 PM
The int built-in will convert a string representing an integer into an actual integer.
>>> x = '5' >>> x '5' >>> int(x) 5 >>> int(x) + 3 8Note that it will raise an error if the string cannot be converted to an int. I don't know if your teacher expects you to be able to handle that.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures