def while_loops(string1: str, string2: str) -> str: """ Given two strings and , return a new string that contains letters from these two strings "interwoven" together, starting with the first character of . If the two strings are not of equal length, then start looping "backward-and-forwards" in the shorter string until you come to the end of the longer string.we ask that you used while loops and keep them simple and precise. >>> while_loops("abcde","12") 'a1b2c1d2e1' >>> while_loops("ab","123") 'a1b2a3' >>> while_loops("abcdfe","123") 'a1b2c3d2f1e2' >>> while_loops("c","ab") 'cacb' """ prove these doctests and write the code in python and don't add any import or any dictionaries or dictionary methods or any try-except statements
def while_loops(string1: str, string2: str) -> str:
"""
Given two strings <string1> and <string2>, return a new string that contains letters from these two strings "interwoven" together, starting with the first character of <string1>. If the two strings are not of equal length, then start looping "backward-and-forwards" in the shorter string until you come to the end of the longer string.we ask that you used while loops and keep them simple and precise.
>>> while_loops("abcde","12")
'a1b2c1d2e1'
>>> while_loops("ab","123")
'a1b2a3'
>>> while_loops("abcdfe","123")
'a1b2c3d2f1e2'
>>> while_loops("c","ab")
'cacb'
"""
prove these doctests and write the code in python and don't add any import or any dictionaries or dictionary methods or any try-except statements
Step by step
Solved in 2 steps with 2 images