9👍
✅
You’re looking for slicing:
>>> s = "Hello World!"
>>> print s[2:] # From the second (third) letter, print the whole string
llo World!
>>> print s[2:5] # Print from the second (third) letter to the fifth string
llo
>>> print s[-2:] # Print from right to left
d!
>>> print s[::2] # Print every second letter
HloWrd
So for your example:
>>> s = 'col555'
>>> print s[3:]
555
2👍
If you know it will always be col
followed by some numbers:
>>> int('col1234'[3:])
1234
- [Django]-Jenkins not failing on tests that fail in coverage
- [Django]-Django-social-auth redirect after login
Source:stackexchange.com