String Formatting

  • + 0 comments

    When we print a binary or any number like:

    print("{}".format(bin(12)))

    The o/p we get is:

    0b1100

    So the given format is to exclude 0b. In your example: 0d for decimal.