Q:

Write a Python program to convert a given Bytearray to Hexadecimal string.

0

Write a Python program to convert a given Bytearray to Hexadecimal string.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def bytearray_to_hexadecimal(list_val):
     result = ''.join('{:02x}'.format(x) for x in list_val)  
     return(result)

list_val = [111, 12, 45, 67, 109] 
print("Original Bytearray :")
print(list_val)
print("\nHexadecimal string:")
print(bytearray_to_hexadecimal(list_val))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now