how to take first digit of number python

>>> number = 1520
>>> int(str(number)[:2])
15

Here is what the above code is Doing:
1. We’re converting the number to a string.
2. We’re taking the first two characters of the string.
3. We’re converting the first two characters back to an integer.