0

I need help with a code to convert any base number into a decimal number, where user input is involved?

number systems

19th May 2019, 10:54 AM
Ed-marie Venter
Ed-marie Venter - avatar
3 Answers
+ 1
please link your code here using the code play ground so that other users can help you out
19th May 2019, 10:59 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 1
let me give you a trick i learned to change different base numbers and turn it into decimal (base 10). int(value, baseOfValue) changing binary into decimal base 2 into base 10 num = "1100" print(int(num, 2)) >>> 12 changing hexadecimal into decimal. base 16 into base 10 num = "c6" print(int(num, 16)) >>> 198
20th May 2019, 7:07 AM
Shen Bapiro
Shen Bapiro - avatar
0
bin -> int hex -> int oct -> int int(input())
19th May 2019, 11:43 PM
Choe
Choe - avatar