Relative Content

Tag Archive for pythonmathbase-conversion

How would I continuously use result in Python

I want to create a program that can convert numbers to binary. I am aware of the bin() function, however I want to use the method that involves dividing the number until its zero by 2 and noting the remainders. The problem I have is that I need to divide until it equals zero. I do not think there is a way to get a result of a mathematical operation inside a while loop and then substitute/use it in the that same code. I don’t think I actually explained this very well, I hope you understand.