Connect with Dashes (1) X77182


Statement
 

pdf   zip   main.py

html

Write a function connect_dashes(str0, str1, n) that receives two strings and a non-negative integer and returns the concatenation of the strings, with n dashes ’-’ between them.

Sample session
>>> connect_dashes('Hi', 'there', 3)
'Hi---there'
>>> connect_dashes('Bye', 'Bye', 0)
'ByeBye'
>>> connect_dashes('--', '--', 2)
'------'
>>> connect_dashes('', '=', 1)
'-='
Information
Author
Jordi Delgado and José Luis Balcázar
Language
English
Official solutions
Python
User solutions
Python