Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions debug_exam.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
be added to the (initially empty)
dictionary to be returned.

In this implementation, data1 is a
In this implementation, data1 is A
dictionary and data2 is a list where
each key-value pair in data2 is also
a list [key, value] of length 2.
Expand All @@ -50,9 +50,13 @@ def uniqueUpdate(data1, data2):
dupKeys[k] = [v1, v2]
# Remove (k, v1) from data1
del data1[k]
else:
# Add (k, v2) to data1
data1[k] = v2
else:
# Add (k, v2) to data1
data1[k] = v2
# After processing all (k, v2) in
# data2, return the dictionary
return dupKeys

# After processing all (k, v2) in
# data2, return the dictionary
return dupKeys
Expand Down