Last active
January 5, 2018 11:38
-
-
Save LiVanych/1792c3d59428b014e328b2c00bef2164 to your computer and use it in GitHub Desktop.
[Decimal to Hex] Convert decimal numbers to hex format. #python #numbers #hex #decimal #convert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python3 | |
| print('%x' % 15) | |
| #f | |
| print('%x' % 16) | |
| #10 | |
| print('%x' % 17) | |
| #11 | |
| print('%x' % 27) | |
| #1b | |
| # Output at least 2 signs | |
| print('%02x' % 15) | |
| #0f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment