Question: I have a list that is the `a=[0,1]` and I want to change with `a=[0x00,0x001]` type. How can I do this? I tried this way 

```
print (struct.pack('>h',a))

```

But I cannot change to hex

Answer: 
Using hex directly should work:

```
>>> a = [0,1]
>>> a = [hex(i) for i in a]
>>> a
['0x0', '0x1']

```
Below is the another way of converting you list of integer to list of hex

```
a = [0,1]
b = map(hex, a) 
# or 
b = map(lambda x:hex(x), a)
# output
print b
['0x1', '0x2']

```