This is a homework assignment so if you don't want to help, I understand that. However, I'm not looking for the algorithm as much as help with Python. I am good with C++, but a couple of my classes this semester are using Python so I'd like to practice it some.
This is the work that I have so far... It works, but I would like to add some checks into the program such as checking to make sure the initial input is in hexadecimal format.
Would it be efficient to just convert the string to a list and check from there?
Thank you for your help,
import binascii #used to convert from hexadecimal to binary
import base64 #used to convert from binary to base64
"""
get hexadecimal value
convert to binary
convert to base64
"""
#conversions
hexa = input("Enter a hexadecimal value: ")
bina = binascii.unhexlify(hexa)
Base64 = base64.b64encode(bina)
#print
print(Base64)
#exit program
input("Exit...")