python binary function code example Example 1: python binary num = 10 bin(num) Example 2: python bin() #Return the binary version of 36: x = bin(36)