Answer:
See Explaination
Step-by-step explanation:
If we do for this sequence :-
for i in alternate_all('abcde','fg','hijk'):
print(i,end='')
The code can be given as :-
def alternate_all(*args):
itrs = [iter(arg) for arg in args]
while itrs != []:
temp = []
for i in range(len(itrs)):
try:
yield next(itrs[i])
temp.append(itrs[i])
except StopIteration:
pass
itrs = temp
The above python code will generate the output as the first value from the first parameter, then the first value from the the second parameter, then the first value from the last parameter and do on.