Ad

Description:

Write a function that converts a base 10 number and returns binary (base 2).

Binary is consisted of zeros and ones only, and those make up the binary number.

Suppose that place value works the same.

Code
Diff
  • def binaryConverter( input ):
        return int( "{:b}".format(input) )
    
    • func binaryConverter(_ input: Int) -> Int {
    • //Your Code Here
    • return input
    • }
    • def binaryConverter( input ):
    • return int( "{:b}".format(input) )