-2
これは、ユーザーが希望する文字列delimで区切られた文字列をn回繰り返して返す関数を作成すると仮定します。私は何が欠けていますか?文字列で区切られた文字列をn回繰り返し返す関数をプログラミングする方法delim
def repeat(string, n, delim) :
return (string + delim) * (n - 1)
def main() :
string = input("Enter a string: ")
n = int(input("Enter the number of times repeat: "))
delim = input("Enter the delim: ")
main()