tsoding / porth

It's like Forth but in Python
629 stars 50 forks source link

Added support for 2, 8 and 16-base integers #75

Closed xenix1337 closed 2 years ago

xenix1337 commented 3 years ago

Just by providing 'base' argument to the int() function in Python, we can allow most popular bases for programmers:

int("0x69", base=0) == 105
int("0b101", base=0) == 5
int("0o420", base=0) == 272

Previous code works the same: int("42069", base=0) == 42069