Nice! just a hint, if you have a return inside the first if you don't need the else ;)
return
if
else
Here's my solution:
def middle_me(middle: str, repeat: str, repeat_quantity: int) -> str: if repeat_quantity % 2 != 0: return middle half = repeat_quantity // 2 content = repeat * repeat_quantity return content[:half] + middle + content[half:]
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice! just a hint, if you have a
return
inside the firstif
you don't need theelse
;)Here's my solution: