How to merge two lists into a dictionarry : I have two lists, list1 and list2. I want to create a dict in which list1 is the keys and list2 is divided equally between them.

for example:

    list1 = ['a','b','c']
    list2 = [1,2,3,4,5,6,7,8]
    result = {'a':[1,2,3], 'b':[4,5,6], 'c':[7,8]}

I thought about doing the following list comprehension:

    num_list2_per_list1 = len(list2)//len(list1)
    result_dict = { list1_member : list2[idx*num_list2_per_list1(1+idx)*num_list2_per_list1] for idx, list1_member in enumerate(list1) }

But this will not work if len(list2) < len(list1). Is there a way to fix this or do I have to make an if statement and split the code?