You are viewing a single comment's thread. Return to all comments →
N = raw_input() # contains a string
N[i] is a character in the string
the subtraction operator '-' is not supported for strings
ord converts the string to an integer (ascii/unicode value) to perform the subtraction.
https://docs.python.org/2/library/functions.html#ord
Seems like cookies are disabled on this browser, please enable them to open this website
Funny String
You are viewing a single comment's thread. Return to all comments →
N = raw_input() # contains a string
N[i] is a character in the string
the subtraction operator '-' is not supported for strings
ord converts the string to an integer (ascii/unicode value) to perform the subtraction.
https://docs.python.org/2/library/functions.html#ord