![]() ![]() Print(b_string) # Print the binary string representation. ![]() Returns: Integer form of the binary string representation.Įxample using int() b_string = bin(89) # For testing purpose, get the binary string representation of 89.Parameters: x = binary string(can be hexadecimal, octal), base = the base of the string literal.Syntax: int(x = binary_string,base = 2).However, we can also convert the string literal of the different base to the integer with the help of kwarg base. ![]() You must have seen int() when you wanted to typecast float or string to the integer format. Approach 1: Using method int() + base argument ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |