I work on python 2, I tried the code available on this site but nothing seemed to work. this is an example of the code I used, however it didnt work:
def repeat_to_length(string_to_expand, length):
return (string_to_expand * ((length/len(string_to_expand))+1))[:length]
I am extremely new to coding and using python so i will appreciate anyone can help me point put my mistake