I'm stuck with this problem for a few days. I wanna create a function that does this with only one line of code:
>>> func1(1, '*', '-')
'*'
>>> func1(2, '*', '-')
'**-**'
>>> func1(3, '*', '-')
'***-***-***'
>>> func1(4, 'z', 'Z')
'zzzzZzzzzZzzzzZzzzz'
So I thought of something like this:
def func(n, s1, s2):
print(n * (n * s1 + s2)
Which would print this:
>>>func(2, '*', '-')
**-**-
Is there any way to get rid of the last "-"?