Is there any value that represents every number in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is there any value that represents every number in python?

I am making a denary to binary converter ?in which I need to have 2 to the power of every number. Is there any way that I could do this

12th May 2018, 2:07 PM
Thomas
Thomas - avatar
2 Answers
+ 1
print(bin(eval(input("enter a number "))))
12th May 2018, 3:55 PM
Etabeta1🇮🇹
Etabeta1🇮🇹 - avatar
0
so how would I do 2 to the power of every number. it's supposed to be: if input is a 2 to the power of something
12th May 2018, 3:58 PM
Thomas
Thomas - avatar