python 3.6 What\'s allowed? is the exhaustive list of things you can use on the
ID: 3853097 • Letter: P
Question
python 3.6
What's allowed? is the exhaustive list of things you can use on the projec all basic expressions/operators, indexing/slicing all basic statements: assignment, selection, and loop statements, break/continue, return here is the exhaustive list of things you can use on the project. . functions: len), range(), min(), max(), sanitize() (you'll write sanitize!) file reading: open), close), read(), readline(), readlines), with syntax dictionaries: all methods listed in our slides on that one chart. methods: ists: remove), insert), append(), extend) pop() strings: strip), split), join), remove(), insert), lower) sorted (), sort(), reversed (), reverse() This means that... ·you can't call anything not listed above. Focus on applying these functions to solve the task. you can't import any modules for this project. (so you can't import csv either-but it isn't that helpful)Explanation / Answer
def zip2(*iterables):
# zip('XYZN', 'ab') --> Xa Yb
iterators = [iter(it) for it in iterables]
while iterators:
result = []
for it in iterators:
try:
elem = next(it)
except StopIteration:
return
result.append(elem)
yield tuple(result)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.