How can trim only (10) numbers in Python

Question:

hashCode = 0x39505b04f1c2e5c03ea3

I want to see only 10 characters, How ?

Asked By: HaMo

||

Answers:

If you want to see the first 10 characters:

hashCode = '0x39505b04f1c2e5c03ea3'

print(hashCode[:10])

outputs:

'0x39505b04'

If you want to instead see the last 10 characters:

hashCode = '0x39505b04f1c2e5c03ea3'

print(hashCode[10:])

outputs:

'f1c2e5c03ea3'
Answered By: user99999
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.