For example, to convert the number 92 to binary:
92 / 2 - quotient = 46 remainder = 0
46 / 2 - quotient = 23 remainder = 0
23 / 2 - quotient = 11 remainder = 1
11 / 2 - quotient = 5 remainder = 1
5 / 2 - quotient = 2 remainder = 1
2 / 2 - quotient = 1 remainder = 0
1 / 2 - quotient = 0 remainder = 1
I want to get results like this No matter how much I googled, I only use divmod or other methods, so I'm asking here. I don't use break and continue!
python while-loop
What is sharing? Finds how many times you can subtract the divisor from the divisor.
Implement the task of infinitely subtracting the divisor from the divisor.
© 2024 OneMinuteCode. All rights reserved.