Python Dictionary MCQ
1). What is the output of the following code?
dict1 = {‘course’:’python’,’institute’:’sqatools’ }
dict2 = {‘name’:’omkar’}
dict2.update(dict1)
print(dict2)
a) {‘name’: ‘omkar’}
b) {‘name’: ‘omkar’, ‘course’: ‘python’, ‘institute’: ‘sqatools’}
c) {‘course’: ‘python’, ‘institute’: ‘sqatools’}
d) {‘course’: ‘python’, ‘institute’: ‘sqatools’, ‘name’: ‘omkar’}
Corresct answer is: d) {‘course’: ‘python’, ‘institute’: ‘sqatools’, ‘name’: ‘omkar’}
Explanation: The `update()` method merges the key-value pairs from `dict1` into `dict2`. Since `dict2` is being updated with the key-value pairs from `dict1`, the resulting dictionary will have all the key-value pairs from both dictionaries. Therefore, the output will be `{‘course’: ‘python’, ‘institute’: ‘sqatools’, ‘name’: ‘omkar’}`.
2). What is the output of the following code?
dict1 = {}
for i in range(1, 6):
dict1[i] = i ** 2
print(dict1)
a) {1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
b) {1: 1, 4: 8, 9: 27, 16: 64, 25: 125}
c) {1: 1, 2: 2, 3: 3, 4: 4, 5: 5}
d) {1: 2, 4: 8, 9: 18, 16: 32, 25: 50}
Corresct answer is: a) {1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
Explanation: The code initializes an empty dictionary `dict1` and then uses a for loop to iterate through the numbers 1 to 5. For each number, it assigns the square of the number as the value to the corresponding key in the dictionary. Therefore, the final dictionary will be {1: 1, 2: 4, 3: 9, 4: 16, 5: 25}.
3). What is the output of the following code?
dict1 = {‘a’: 2, ‘b’: 4, ‘c’: 5}
result = 1
for val in dict1.values():
result *= val
print(result)
a) 8
b) 20
c) 40
d) 60
Corresct answer is: c) 40
Explanation: The code initializes `result` as 1 and then iterates over the values in `dict1`. It multiplies each value with `result` using the `*=` operator. Therefore, the result is the product of all the values: `2 * 4 * 5 = 40`.
4). What is the output of the following code?
dict1 = {‘a’: 2, ‘b’: 4, ‘c’: 5}
if ‘c’ in dict1:
del dict1[‘c’]
print(dict1)
a) {‘a’: 2, ‘b’: 4}
b) {‘a’: 2, ‘b’: 4, ‘c’: 5}
c) {‘a’: 2, ‘b’: 4, ‘c’: None}
d) Error
Corresct answer is: a) {‘a’: 2, ‘b’: 4}
Explanation: The code checks if the key ‘c’ is present in the dictionary using the `in` keyword. Since ‘c’ exists as a key in dict1, the block of code inside the `if` statement is executed. The `del` statement removes the key-value pair with the key ‘c’ from the dictionary. Therefore, the resulting dictionary is {‘a’: 2, ‘b’: 4}.
5). What is the output of the following code?
list1 = [‘name’, ‘sport’, ‘rank’, ‘age’]
list2 = [‘Virat’, ‘cricket’, 1, 32]
new_dict = dict(zip(list1, list2))
print(new_dict)
a) {‘name’: ‘Virat’, ‘sport’: ‘cricket’, ‘rank’: 1, ‘age’: 32}
b) {‘Virat’: ‘name’, ‘cricket’: ‘sport’, 1: ‘rank’, 32: ‘age’}
c) {‘name’: ‘Virat’, ‘sport’: ‘cricket’}
d) Error
Corresct answer is: a) {‘name’: ‘Virat’, ‘sport’: ‘cricket’, ‘rank’: 1, ‘age’: 32}
Explanation: The code creates a new dictionary by combining the elements of `list1` as keys and `list2` as values using the `zip()` function. The resulting dictionary has the key-value pairs {‘name’: ‘Virat’, ‘sport’: ‘cricket’, ‘rank’: 1, ‘age’: 32}.
6). What is the output of the following code?
dict1 = {‘a’: 10, ‘b’: 44, ‘c’: 60, ‘d’: 25}
list1 = []
for val in dict1.values():
list1.append(val)
list1.sort()
print(“Minimum value: “, list1[0])
print(“Maximum value: “, list1[-1])
a) Minimum value: 10, Maximum value: 60
b) Minimum value: 25, Maximum value: 60
c) Minimum value: 10, Maximum value: 44
d) Minimum value: 25, Maximum value: 44
Corresct answer is: a) Minimum value: 10, Maximum value: 60
Explanation: The code creates a list, `list1`, and appends all the values from `dict1` to it. The list is then sorted in ascending order using the `sort()` method. The first element of the sorted list (`list1[0]`) is the minimum value, which is 10. The last element of the sorted list (`list1[-1]`) is the maximum value, which is 60. Therefore, the output will be “Minimum value: 10, Maximum value: 60”.
7). What is the output of the code snippet?
from collections import defaultdict
list1 = [1, 3, 4, 4, 2, 5, 3, 1, 5, 5, 2]
print(“The original list: “, list1)
dict1 = defaultdict(list)
for val in list1:
dict1[val].append(val)
print(“Similar grouped dictionary: “, dict1)
a) The original list: [1, 3, 4, 4, 2, 5, 3, 1, 5, 5, 2]
Similar grouped dictionary: {1: [1, 1], 3: [3, 3], 4: [4, 4], 2: [2, 2], 5: [5, 5, 5, 5]}
b) The original list: [1, 3, 4, 4, 2, 5, 3, 1, 5, 5, 2]
Similar grouped dictionary: {1: [1, 1], 3: [3, 3], 4: [4, 4], 2: [2, 2], 5: [5, 5]}
c) The original list: [1, 3, 4, 4, 2, 5, 3, 1, 5, 5, 2]
Similar grouped dictionary: {1: [1, 1], 3: [3, 3], 4: [4, 4], 2: [2, 2], 5: [5, 5, 5]}
d) The original list: [1, 3, 4, 4, 2, 5, 3, 1, 5, 5, 2]
Similar grouped dictionary: {1: [1, 1], 3: [3, 3], 4: [4, 4], 2: [2, 2], 5: [5, 5, 5]}
Corresct answer is: c) The original list: [1, 3, 4, 4, 2, 5, 3, 1, 5, 5, 2]
Similar grouped dictionary: {1: [1, 1], 3: [3, 3], 4: [4, 4], 2: [2, 2], 5: [5, 5, 5]}
Explanation: The code uses the `defaultdict` class from the `collections` module. A `defaultdict` is a subclass of a dictionary that provides a default value for a nonexistent key. In this code, the default value is an empty list.The code then creates an empty `defaultdict` called `dict1`. It iterates over each value in `list1`. For each value, it appends the value itself to the corresponding key in the dictionary. This results in grouping similar values together.The resulting similar grouped dictionary is printed as: {1: [1, 1], 3: [3, 3], 4: [4, 4], 2: [2, 2], 5: [5, 5, 5]}
8). What is the output of the following code?
string = ‘learning python at sqa-tools’
Dict = {‘at’: ‘is’, ‘sqa-tools’: ‘fun’}
for key, value in Dict.items():
string = string.replace(key, value)
print(string)
a) ‘learning python is fun’
b) ‘learning python at sqa-tools’
c) ‘learning python at fun’
d) ‘learning python is sqa-tools’
Corresct answer is: a) ‘learning python is fun’
Explanation: The code iterates over the key-value pairs in the dictionary `Dict`. For each key-value pair, it replaces all occurrences of the key in the `string` with the corresponding value using the `replace()` method. In the first iteration, ‘at’ is replaced with ‘is’, resulting in the string: ‘learning python is sqa-tools’. In the second iteration, ‘sqa-tools’ is replaced with ‘fun’, resulting in the final string: ‘learning python is fun’. The modified `string` is printed, which outputs ‘learning python is fun’.
9). What is the output of the following code?
String = ‘sqatools is best for learning python’
Dict = {‘best’:2,’learning’:6}
str2 = “”
for word in String.split(” “):
if word not in Dict:
str2 += word + ” “
print(str2)
a) ‘sqatools is best for learning python’
b) ‘sqatools is for python’
c) ‘is for python’
d) ‘sqatools is best for’
Corresct answer is: b) ‘sqatools is for python’
Explanation: The code iterates over each word in the `String` variable, splitting it by spaces. It checks if each word is present in the `Dict` dictionary. If a word is not found in the dictionary, it is appended to the `str2` variable followed by a space. In this case, the words ‘best’ and ‘learning’ are present in the dictionary, so they are not included in `str2`. Hence, the output is ‘sqatools is for python’.
10). What is the output of the following code?
dict1 = {}
if len(dict1) > 0:
print(“Dictionary is not empty”)
else:
print(“Dictionary is empty”
a) “Dictionary is not empty”
b) “Dictionary is empty”
c) Error
d) None
Corresct answer is: b) “Dictionary is empty”
Explanation: The code initializes an empty dictionary `dict1`. The `len(dict1)` function returns the number of key-value pairs in the dictionary, which is 0 in this case. Since the condition `len(dict1) > 0` is not satisfied, the code enters the `else` block and prints “Dictionary is empty”.
11). What will be the output of the following code snippet?
Dict1 = {‘x’:10,’y’:20,’c’:50,’f’:44 }
Dict2 = {‘x’:60,’c’:25,’y’:56}
for key in Dict1:
for k in Dict2:
if key == k:
a = Dict1[key]+Dict2[k]
Dict2[key] = a
print(Dict2)
a) {‘x’: 70, ‘c’: 75, ‘y’: 76}
b) {‘x’: 60, ‘c’: 25, ‘y’: 56}
c) {‘x’: 10, ‘y’: 20, ‘c’: 50, ‘f’: 44}
d) {‘x’: 10, ‘y’: 20, ‘c’: 50, ‘f’: 44, ‘y’: 76}
Corresct answer is: a) {‘x’: 70, ‘c’: 75, ‘y’: 76}
Explanation: The code iterates through each key in Dict1 and checks if it exists as a key in Dict2. If a matching key is found, the corresponding values from Dict1 and Dict2 are added together and stored in variable ‘a’. Then, the key-value pair in Dict2 is updated with the new value ‘a’. Finally, the updated Dict2 is printed, which will be {‘x’: 70, ‘c’: 75, ‘y’: 76}. The value for key ‘x’ is 10 + 60 = 70, the value for key ‘c’ is 50 + 25 = 75, and the value for key ‘y’ is 20 + 56 = 76. The key ‘f’ from Dict1 is not present in Dict2, so it remains unchanged in the final result.
12). What is the output of the following Python code?
list1 = [{‘name1′:’robert’},{‘name2′:’john’},{‘name3′:’jim’}, {‘name4′:’robert’}]
list2 = []
for val in list1:
for ele in val.values():
if ele not in list2:
list2.append(ele)
print(list2)
a) [‘robert’, ‘john’, ‘jim’]
b) [‘robert’, ‘john’, ‘jim’, ‘robert’]
c) [‘john’, ‘jim’]
d) [‘robert’]
Corresct answer is: a) [‘robert’, ‘john’, ‘jim’]
Explanation: The code iterates over each dictionary in `list1` using the variable `val`. Then, within each dictionary, it retrieves the value using the `values()` method. The retrieved value is checked if it already exists in `list2`. If not, it is appended to `list2`. Since the value ‘robert’ appears twice in `list1`, it is added twice to `list2`. Therefore, the output will be `[‘robert’, ‘john’, ‘jim’]`.
13). What is the output of the following code?
import pandas as pd
dict1 = {‘names’:[‘virat’,’messi’,’kobe’],’sport’:[‘cricket’,’football’,’basketball’]}
table = pd.DataFrame(dict1)
print(table)
a)
| | names | sport |
|—|——-|————|
| 0 | virat | cricket |
| 1 | messi | football |
| 2 | kobe | basketball |
b)
| | names | sport |
|—|——-|————|
| 0 | virat | football |
| 1 | messi | cricket |
| 2 | kobe | basketball |
c)
| | names | sport |
|—|——-|————|
| 0 | virat | basketball |
| 1 | messi | cricket |
| 2 | kobe | football |
d)
| | names | sport |
|—|——-|————|
| 0 | virat | cricket |
| 1 | kobe | basketball |
| 2 | messi | football |
Corresct answer is: a)
| | names | sport |
|—|——-|————|
| 0 | virat | cricket |
| 1 | messi | football |
| 2 | kobe | basketball |
Explanation: The code creates a dictionary called `dict1` with two keys: ‘names’ and ‘sport’, and their corresponding values as lists. It then creates a DataFrame using `pd.DataFrame()` by passing the dictionary as an argument. The DataFrame is displayed using `print(table)`. The resulting table has three rows, where each row represents a player’s name and their associated sport.
14). What is the output of the following code?
list1 = [2, 5, 8, 1, 2, 6, 8, 5, 2]
dict1 = {}
for val in list1:
dict1[val] = list1.count(val)
print(dict1)
a) {1: 1, 2: 3, 5: 2, 6: 1, 8: 2}
b) {2: 3, 5: 2, 8: 2, 1: 1, 6: 1}
c) {2: 3, 5: 2, 8: 2, 1: 1, 6: 1, 0: 0}
d) {2: 3, 5: 2, 8: 2, 1: 1, 6: 1, 9: 0}
Corresct answer is: a) {1: 1, 2: 3, 5: 2, 6: 1, 8: 2}
Explanation: The code creates an empty dictionary `dict1` and then iterates over each value in `list1`. For each value, it counts the number of occurrences using `list1.count(val)` and assigns that count as the value in the dictionary with the value itself as the key. The resulting dictionary will contain the counts of each unique value from the list.In this case, the output dictionary will be `{1: 1, 2: 3, 5: 2, 6: 1, 8: 2}`. Value 1 appears once, value 2 appears three times, value 5 appears twice, value 6 appears once, and value 8 appears twice.
15). What is the output of the following code?
dict1 = {‘m1’: 25, ‘m2’: 20, ‘m3’: 15}
total = 0
count = 0
for val in dict1.values():
total += val
count += 1
print(“Mean: “, (total / count))
a) Mean: 25
b) Mean: 20
c) Mean: 15
d) Mean: 20.0
Corresct answer is: d) Mean: 20.0
Explanation: The code calculates the mean of the values in the dict1 dictionary. It iterates over the values using a loop, calculates the total sum of the values, and increments the count. Finally, it prints the mean by dividing the total by the count. In this case, the mean is 20.0.
16). What is the output of the following code?
list1 = [‘a’, ‘b’, ‘c’, ‘d’]
new_dict = current = {}
for char in list1:
current[char] = {}
current = current[char]
print(new_dict)
a) {‘a’: {‘b’: {‘c’: {‘d’: {}}}}}
b) {‘d’: {‘c’: {‘b’: {‘a’: {}}}}}
c) {‘a’: {}, ‘b’: {}, ‘c’: {}, ‘d’: {}}
d) {‘d’: {}, ‘c’: {}, ‘b’: {}, ‘a’: {}}
Corresct answer is: a) {‘a’: {‘b’: {‘c’: {‘d’: {}}}}}
Explanation: The given code iterates over each character in the list list1. It creates nested dictionaries where each character becomes a key for the next nested dictionary.
17). What is the output of the following code?
dict1 = {‘a1’: [1, 5, 3], ‘a2’: [10, 6, 20]}
for val in dict1.values():
val.sort()
print(dict1)
a) {‘a1’: [1, 3, 5], ‘a2’: [6, 10, 20]}
b) {‘a1’: [1, 5, 3], ‘a2’: [10, 6, 20]}
c) {‘a1’: [1, 5, 3], ‘a2’: [6, 10, 20]}
d) {‘a1’: [1, 3, 5], ‘a2’: [10, 20, 6]}
Corresct answer is: a) {‘a1’: [1, 3, 5], ‘a2’: [6, 10, 20]}
Explanation: The code iterates over the values in `dict1` using a for loop. Each value, which is a list, is sorted in ascending order using the `sort()` method. After the loop, the dictionary `dict1` is printed. Since lists are mutable objects, sorting the values in-place affects the original dictionary. Therefore, the output will be `{‘a1’: [1, 3, 5], ‘a2’: [6, 10, 20]}` with the values sorted in ascending order within each list.
18). What is the output of the following code?
dict1 = {‘virat’:{‘sport’:’cricket’,’team’:’india’},
‘messi’:{‘sport’:’football’,’team’:’argentina’}}
for key, val in dict1.items():
print(key)
for k,v in val.items():
print(k,”:”,v)
a) virat
sport: cricket
team: india
messi
sport: football
team: argentina
b) virat
sport: cricket
messi
sport: football
team: argentina
c) virat: sport: cricket, team: india
messi: sport: football, team: argentina
d) sport: cricket, team: india
sport: football, team: argentina
Corresct answer is: a) virat
sport: cricket
team: india
messi
sport: football
team: argentina
Explanation: The code iterates over the items of the `dict1` dictionary. For each key-value pair, it prints the key and then iterates over the nested dictionary `val`. For each key-value pair in `val`, it prints the key and value. Therefore, the output includes the keys ‘virat’ and ‘messi’, followed by their respective key-value pairs from the nested dictionaries.
19). What is the output of the following code?
dict1 = {‘sqa’:[1,4,6],’tools’:[3,6,9]}
list1 = []
for key,val in dict1.items():
l = []
l.append(key)
for ele in val:
l.append(ele)
list1.append(list(l))
print(list1)
a) [[‘sqa’, 1, 4, 6], [‘tools’, 3, 6, 9]]
b) [[‘sqa’, [1, 4, 6]], [‘tools’, [3, 6, 9]]]
c) [[‘sqa’, 1], [‘sqa’, 4], [‘sqa’, 6], [‘tools’, 3], [‘tools’, 6], [‘tools’, 9]]
d) [[‘sqa’, [1, 4, 6]], [‘tools’, [3, 6, 9]], [‘sqa’, [1, 4, 6]], [‘tools’, [3, 6, 9]]]
Corresct answer is: a) [[‘sqa’, 1, 4, 6], [‘tools’, 3, 6, 9]]
Explanation: The code iterates over the key-value pairs in the dictionary. For each pair, it creates a new list and appends the key followed by the values from the corresponding list. These lists are then appended to the list1. The final output is [[‘sqa’, 1, 4, 6], [‘tools’, 3, 6, 9]].
20). What is the output of the following code?
dict1 = [{‘sqa’: 123, ‘tools’: 456}]
l = []
for ele in dict1:
for k in ele.keys():
a = []
a.append(k)
l.append(a)
for v in ele.values():
b = []
b.append(v)
l.append(b)
print(l)
a) [[‘sqa’], [123], [‘tools’], [456]]
b) [{‘sqa’}, {123}, {‘tools’}, {456}]
c) [[‘sqa’, ‘tools’], [123, 456]]
d) [[{‘sqa’: 123, ‘tools’: 456}]]
Corresct answer is: a) [[‘sqa’], [123], [‘tools’], [456]]
Explanation: The code iterates over the list `dict1` which contains a single dictionary element. For each dictionary element, it retrieves the keys using `ele.keys()` and appends them as separate lists to `l`. Then it retrieves the values using `ele.values()` and appends them as separate lists to `l`. Finally, it prints the resulting list `l`, which contains individual lists for each key and value. Therefore, the output will be `[[‘sqa’], [123], [‘tools’], [456]]`.
21). What is the output of the following code?
dict1 = {‘virat’: [‘match1’, ‘match2’, ‘match3’], ‘rohit’: [‘match1’, ‘match2’]}
count = 0
for val in dict1.values():
for ele in val:
count += 1
print(“Items in the list of values: “, count)
a) 3
b) 5
c) 6
d) 8
Corresct answer is: b) 5
Explanation: The code snippet iterates over the values of the dictionary `dict1`. For each value, it iterates over the elements using a nested loop. In this case, the values are `[‘match1’, ‘match2’, ‘match3’]` and `[‘match1’, ‘match2’]`. So, the total count of items in the list of values is 5.
22). What is the output of the following code?
dict1 = {‘Math’:70,’Physics’:90,’Chemistry’:67}
a = sorted(dict1.items(), key = lambda val:val[1], reverse = True)
print(a)
a) [(‘Physics’, 90), (‘Math’, 70), (‘Chemistry’, 67)]
b) [(‘Math’, 70), (‘Physics’, 90), (‘Chemistry’, 67)]
c) [(‘Chemistry’, 67), (‘Math’, 70), (‘Physics’, 90)]
d) [(‘Physics’, 90), (‘Chemistry’, 67), (‘Math’, 70)]
Corresct answer is: a) [(‘Physics’, 90), (‘Math’, 70), (‘Chemistry’, 67)]
Explanation: The code sorts the dictionary items based on the values in descending order. The sorted() function is called with the key argument set to a lambda function that returns the value of each item. The reverse parameter is set to True to sort in descending order. The output is a list of tuples, where each tuple contains a key-value pair from the original dictionary, sorted by the values in descending order.
23). What is the output of the following code?
dict1 = [{‘name’: ‘ketan’, ‘subject’: ‘maths’, ‘p1’: 80, ‘p2’: 70}]
for d in dict1:
n1 = d.pop(‘p1’)
n2 = d.pop(‘p2’)
d[‘p1+p2’] = (n1 + n2) / 2
print(dict1)
a) [{‘name’: ‘ketan’, ‘subject’: ‘maths’, ‘p1+p2’: 150}]
b) [{‘name’: ‘ketan’, ‘subject’: ‘maths’, ‘p1+p2’: 75}]
c) [{‘name’: ‘ketan’, ‘subject’: ‘maths’, ‘p1’: 80, ‘p2’: 70, ‘p1+p2’: 75}]
d) Error
Corresct answer is: b) [{‘name’: ‘ketan’, ‘subject’: ‘maths’, ‘p1+p2’: 75}]
Explanation: The code iterates over the list of dictionaries. For each dictionary, it removes the ‘p1’ and ‘p2’ keys and calculates their average. Then, it adds a new key ‘p1+p2’ with the calculated average value. Finally, it prints the modified list of dictionaries. In this case, the output will be [{‘name’: ‘ketan’, ‘subject’: ‘maths’, ‘p1+p2’: 75}] because the average of 80 and 70 is 75.
24). What is the output of the given code?
dict1 = {‘k1′:’p’,’k2′:’q’,’k3′:’r’}
dict2 = {‘k1′:’p’,’k2′:’s’}
for key in dict1:
if key in dict2:
print(f”{key} is present in both dictionaries”)
else:
print(f”{key} is present not in both dictionaries”)
a) k1 is present in both dictionaries
k2 is present not in both dictionaries
k3 is present not in both dictionaries
b) k1 is present in both dictionaries
k2 is present in both dictionaries
k3 is present not in both dictionaries
c) k1 is present in both dictionaries
k2 is present in both dictionaries
k3 is present in both dictionaries
d) k1 is present in both dictionaries
k2 is present not in both dictionaries
k3 is present in both dictionaries
Corresct answer is: b) k1 is present in both dictionaries
k2 is present in both dictionaries
k3 is present not in both dictionaries
Explanation: The given code iterates over the keys of `dict1`. It checks if each key is present in `dict2`. If a key is found in both dictionaries, it prints that the key is present in both dictionaries. If a key is only present in `dict1`, it prints that the key is not present in both dictionaries. In this case, ‘k1’ is present in both dictionaries, ‘k2’ is present in both dictionaries, and ‘k3’ is present only in `dict1`.
25). What is the output of the code snippet?
l1 = []
for i in range(1, 6):
l1.append(i)
l2 = []
for i in range(6, 11):
l2.append(i)
l3 = []
for i in range(11, 16):
l3.append(i)
dict1 = {}
dict1[“a”] = l1
dict1[“b”] = l2
dict1[“c”] = l3
print(dict1)
a) {‘a’: [1, 2, 3, 4, 5], ‘b’: [6, 7, 8, 9, 10], ‘c’: [11, 12, 13, 14, 15]}
b) {‘a’: [1, 2, 3, 4, 5], ‘b’: [1, 2, 3, 4, 5], ‘c’: [1, 2, 3, 4, 5]}
c) {‘a’: [1, 2, 3, 4], ‘b’: [6, 7, 8, 9], ‘c’: [11, 12, 13, 14]}
d) {‘a’: [1, 2, 3, 4], ‘b’: [5, 6, 7, 8], ‘c’: [9, 10, 11, 12]}
Corresct answer is: a) {‘a’: [1, 2, 3, 4, 5], ‘b’: [6, 7, 8, 9, 10], ‘c’: [11, 12, 13, 14, 15]}
Explanation: The code creates three lists, `l1`, `l2`, and `l3`, and populates them with consecutive numbers using range(). Then, a dictionary `dict1` is created with keys ‘a’, ‘b’, and ‘c’, and their respective values are assigned as `l1`, `l2`, and `l3`. Finally, the dictionary is printed, resulting in `{‘a’: [1, 2, 3, 4, 5], ‘b’: [6, 7, 8, 9, 10], ‘c’: [11, 12, 13, 14, 15]}`.