I am trying to create a function with two arguments x and y that creates a list of y times repeated elements X , but im confused about how to do this, which or which method to use, I think the list compression can do, but I want more short and simple method for example, I want my simple code to be like this
if y = 4 and x = 7 result is list of elements (7, 7, 7, 7)
how can i get around any ideas? books or anything that will give me the key, I tried searching, but I had no luck.
source share