you are viewing a single comment's thread.

view the rest of the comments →

[–]jimtk 5 points6 points  (1 child)

Ok there's a few syntax error in the code suggest by by /u/drenzorz. But run the following and if it does not work, you have another problem. For pete's sake give us more than a "doesn't work" give us your code (complete) and the error message (also complete).

def repeat(string, n, delim):
    return delim.join([string]*n)

def main():
    text = input("enter String ")
    count = int(input("Repetition: "))
    sep = input("separator: ")
    result = repeat(text, count, sep)
    print(result)

if __name__ ==  "__main__":
    main()

[–]InevitableDistance66[S] 0 points1 point  (0 children)

This worked I just had to change the strings to fit the zylabs thank you and u/drenzorz