Question: def sum_of_strings(str1, str2, delim): str1: str str2: str delim: str Returns a str. str1 and str2 are strings that contain numeric characters separated by
def sum_of_strings(str1, str2, delim): """ str1: str str2: str delim: str Returns a str. str1 and str2 are strings that contain numeric characters separated by a delimeter, delim. It is guaranteed that str1 and str2 only consist of numeric characters and the delim character. str1 and str2 have length of at least 1, and have the same number of occurences of delim. You are guaranteed that successive appearances of delim have numeric characters in between; i.e. delim will never appear consecutively more than once. The function should return the sum of each pair of numeric values from str1 and str2, in the order that they appear from left to right. For example: >>> str1 = "10;1;200;12" >>> str2 = "1;20;10;2" >>> delim = ";" >>> sum_of_strings(str1, str2, delim) '11;21;210;14' """
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
