Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
no the
int()
function converts from any number system to decimal. if you wanted to convert to, say, binary you'd have to use thebin()
function.OHhh ok. Thank you for the expanation. Just one more question, is the output from the int function always in base 10 or is there a 3rd parameter we can give the function to output the convertion in other base systems?
int converts a data type to integer. It can convert strings of numbers from other number base systems via the second optional input for the function. Eg:
int("1001",2) == 9
because it is converting a base-2 string of numbers into denary. In this case, 16 was used because hexadecimal is a base-16 number system.Can anybody explain the role of int() here. I didn't know that int can take in more than one parameter. Sorry, new to programming here