how do i get a code to write in a single line as output? : 1 2 3 4 2 2 3 4 3 2 3 4, how to write a code if a variable is a list of numbers 1-4 and another variable is no of times it needs to repeat. in this case x = [1,2,3,4] and y = 3

i have already tried to loop it for measures times and adding 1 to first number but cannot add them in a single line


> beats_per_measure = 4 measures = 5 for a in range(0, measures):
>     x = str(a + 1)
>     for i in range(2, beats_per_measure + 1):
>         y= x + str(i)
>         print(y)

   

you should replace the
#number 1 with the number of the current measure. So, the first
#number in each measure will always rise. like for first measure it reads 1234 and for second it reads 2234 and so on, all printed in a single line

