def dec_to_bin(number):
result = ''
while number > 0:
result = str(number % 2) + result
number //= 2
return result
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
def dec_to_bin(number):
result = ''
while number > 0:
result = str(number % 2) + result
number //= 2
return result