Your code should not mutate the given lists. Tip: the sort method could be useful here. [2.5pts] Write the function pairs(list1, list2) that takestwo lists of items, list1 and list2, and returns (not prints) a new list that contains lists with the k-th elements of the two lists coupled together.
You can assume the lengths of the two lists are the same.
[5pts] Write the function successorWords(file), where file is a string that contains the name of a txt file that contains multiple strings. This function returns (not prints) a dictionary whose keys are included words (as is), and values are lists of successors to those words. The first word of the txt file is always a successor to ".". Be careful with contraction words. The starter code already contains the code to read the txt file, just make sure the file is in the same directory as your .py file. Note that you have to write your code in two places, before reading the file and after Tip: isalnum, the join method and slicing could be useful here.
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.def common(list1, list2):
[1, 3, 12, 44]
>>> common(1, [3.5]) is None
# --- YOU CODE STARTS HERE
if isinstance(list1, list) == False:
if isinstance(list2, list) == False:
for x in range(len(l1)):
for y in range(len(l2)):
flag = 0
for z in range(len(result)):
if l1[x] == result[z]:
flag = 1
if flag == 0:
By purchasing this solution you'll be able to access the following files:
article.txt and starter.py.