Posts by Gabriel Albuquerque • 1 point
1 post
-
0
votes1
answer601
viewsQ: Convert number to binary
I’m having trouble with the logic of my code: dec = (10) dup = dec co = 2 exp = 0 res = (tuple) while True: dup = dec dec = int(dec / co) exp += dup * co print(f'dec {dec} dup {dup} exp {exp}') if…