def display(xs):
string1 = ''
for i in range(len(xs)):
string1+=str(xs[i])+'-'
return string1
Given a list of tuples as xs = [(2,3),(4,4),(5,5),(6,6)]
.Return this list as a string, by adding them up with dashes '-'.
So I wan to return a string that looks something like '(2,3)-(4,4)-(5,5)-(6,6)'
.
What my code does is it correctly adds the dashes but the errors I am getting is that is doesn't read in the first value and it also ends up with an extra dash at the end.
My code returns a string that looks like '(4,4)-(5,5)-(6,6)-'
which is wrong. I have shown my code above and need help fixing this.