A numeric base determines how Python interprets digit characters when converting a string to an integer. Pass the base as int’s optional second argument. section 2.15
The same input, different bases
The string "10" can represent different values: int("10", 2) interprets it as 2, while int("10", 16) interprets it as 16. A hexadecimal conversion therefore passes 16 explicitly. section 2.15 section 2.5
Use numeric bases as practice problems:
- Extend a guessing game so each round selects a random base from 2 through 16 and interprets the user’s input accordingly. section 2.5
- Reimplement conversion without int, using ord and chr to recognize legal characters for the selected base. section 2.17

