Oct-24-2018, 06:40 PM
If you're using Python 2.7 or higher, PEP 274 -- Dict Comprehensions may help you.
lst = [['Helloworld', 'W', 'R'], ['pinglog', 'W'], ['data', 'X', 'W', 'R']] my_dict = {item[0] : item[1:] for item in lst}