Given a non-negative integer n, write a function to_binary/ToBinary which returns that number in a binary format. to_binary(1) # should return 1 to_binary(5) # should return 101 to_binary(11) # should return 1011
def to_binary(n): return bin(n)
Given a non-negative integer n, write a function to_binary/ToBinary which returns that number in a binary format. to_binary(1) # should return 1 to_binary(5) # should return 101 to_binary(11) # should return 1011
def to_binary(n): return bin(n)
Generate
More than just a code generator. A tool that helps you with a wide range of tasks. All in one place.
Function from Description
Text Description to SQL Command
Translate Languages
Generate HTML from Description
Code to Explanation
Fix invalid Code
Get Test for Code
Class from Description
Regex from Description
Regex to Explanation
Git Command from Description
Linux Command
Function from Docstring
Add typing to code
Get Language from Code
Time complexity
CSS from Description
Meta Tags from Description
− sponsored −