Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can trim only (10) numbers in Python

hashCode = 0x39505b04f1c2e5c03ea3

I want to see only 10 characters, How ?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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'
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading