Question: python mix_strings (str1, str2) returns a combined string. E.g.: mix_strings(hello, there) returns htehlelroe mix_strings(1234, abed) returns 1a2b3c4d mix_strings(12, abed) returns la2bcd mix_strings(1234, ab) returns 1a2b34
python
mix_strings (str1, str2) returns a combined string. E.g.: mix_strings("hello", "there") returns "htehlelroe" mix_strings("1234", "abed") returns "1a2b3c4d" mix_strings("12", "abed") returns "la2bcd" mix_strings("1234", "ab") returns "1a2b34" mix_files(fname1, fname2, outfile) returns a combined string. E.g.: What happens if one string/file is longer than the other? There are two approaches: Loop over the shortest string & then loop over the longest string Loop over the longest string & have an if inside the loop for the shorter string mix_strings (str1, str2) returns a combined string. E.g.: mix_strings("hello", "there") returns "htehlelroe" mix_strings("1234", "abed") returns "1a2b3c4d" mix_strings("12", "abed") returns "la2bcd" mix_strings("1234", "ab") returns "1a2b34" mix_files(fname1, fname2, outfile) returns a combined string. E.g.: What happens if one string/file is longer than the other? There are two approaches: Loop over the shortest string & then loop over the longest string Loop over the longest string & have an if inside the loop for the shorter string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
