0
I'm created this to convert binary number to decimal number. But it give wrong output. How can I make this work properly ?
5 Answers
+ 1
Yes, x[z] is basicly an str, and since the input are 0 and 1 which is a number, sure
+ 1
Convert x[z] to int forst before doing any checking or calculation with other int
And x[z:z+1] you can simply use x[z]
+ 1
replace x[] to int(x[])
0
where can i do that change
0
are you sure [] works with int?