+ 2
What are some ways to write a function that converts int numbers to binary in python?
2 Respostas
+ 7
Nathan Trapero
1.using recursion:
DecToBin(num):
if num > 1:
DecToBin(num // 2)
print num % 2
2.using built in function:
dec=89
print(bin(dec))
+ 5
You can use bin () function