I want to get only the numbers from a string. For example I have something like this
just=\'Standard Price:20000\'
And I only want it to pr
You could use RegEx
>>> import re
>>> just='Standard Price:20000'
>>> re.search(r'\d+',just).group()
'20000'
Ref: \d matches digits from 0 to 9
just[0] evaluates to S as it is the 0th character. Thus S[1:] returns an empty string that is '', because the string is of length 1 and there are no other characters after length 1