Im completing a online beginner course in python one of my tasks is to design a simple decimal to binary to hex converter. Ive written the initial code but im a bit stumped on displaying the lists side by side. This is what the course says:
1 Print values (for this option display a heading for “denary binary hex” and use your lists to print a table showing the values corresponding to 0 to 15 for each number base i.e.
denary binary hexadecimal
0 0000 0
1 0001 1
etc
This is the code Ive written.
binary_list=["0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"]
hex_list=[0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"]
decimal_list=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
print("What operation would you like to carry out today?")
option=input("Enter choice \n1. See a comparison of the first few decimal numbers converted to binary and hex values\n2. Convert denary number to binary or hex\n3. Convert a hex value between 0 and 15 to denary or binary value\n9. Quit")
print decimal_list
print hex_list
print binary_list
It really dosent work to put them into a table, and im not really sure how to do it. Again I am a first timer with python, and im only meant to be using def statements etc so if you could, please use basic coding.
Thank you all