Python Number Converter (program) which will convert a decimalnumber (base 10) to its equivalent in Hexadecimal
Question:
Python “Number Converter” (program) which will convert a decimalnumber (base 10) to its equivalent in –
- Hexadecimal (base 16)
- Octal (base 8)
- Binary (base 2) values.
Sample Test Runs
Number Converter -> convert a number (between 0 and 255)from
Enter 1 -- Decimal to Hexadecimal
Enter 2 -- Decimal to Octal
Enter 3 -- Decimal to Binary (Between 0 and 64)
Enter X -- Exit
Enter your choice: 5
Invalid choice
Number Converter -> convert a number (between 0 and 255)from
Enter 1 -- Decimal to Hexadecimal
Enter 2 -- Decimal to Octal
Enter 3 -- Decimal to Binary (Between 0 and 64)
Enter X -- Exit
Enter your choice: a
Invalid choice
Number Converter -> convert a number (between 0 and 255)from
Enter 1 -- Decimal to Hexadecimal
Enter 2 -- Decimal to Octal
Enter 3 -- Decimal to Binary (Between 0 and 64)
Enter X -- Exit
Enter your choice: 1
Enter a decimal number: 300
Invalid input value. Try again
Introductory Statistics Exploring The World Through Data
ISBN: 9780321978271
2nd Edition
Authors: Robert Gould, Colleen Ryan