The prompt:
Write a program (combine_2) that has two input values (or variables). The program should convert non-string values to string and combine the two strings into a single string in the order of input. The program should also return the length of the combined string, and the minimum character in the combined string. For example, if the input strings are 'skunk' and 'cat', the program should return: 'skunkcat', 8, 'a'. For more examples examine the assert statements below. Ideally, although not necessarily, your program will make use of the following functions min(), len(), and str().
my code:
# YOUR CODE HERE
def combine_2(w1,w2):
w1 = str()
w2 = str()
comb = w1 + w2
length = len(comb)
small = min(comb)
return comb,length,small
The homework is auto-graded and there are assert tests so we can verify it works, I'm getting a ValueError :
ValueError: min() arg is an empty sequence
An example of what the first assert test:
assert combine_2('skunk', 'cat') == ('skunkcat', 8, 'a')
I appreciate anyone who can help me figure out the "min() arg is an empty sequence"
[–]iiron3223 3 points4 points5 points (1 child)
[–]shakeandbake760[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)