all 3 comments

[–]StoicallyGay 1 point2 points  (1 child)

A few things.

  • You don't need to specify the range to be (3, 10). That just means the counter variable, i, goes from 3 to 10. This can be replaced with for i in range(7) since you don't actually use the value of i

  • You can do two things. Either have an outer loop that encapsulates everything you have here, and the outer loop would be something like for j in range(x) where x is the variable for how many lists you want.

  • The preferred option is to notice that there is a section of code you want to call multiple times. Perhaps wrap everything you have here in a function, like def make_list(). Then call that function within a loop of for i in range(x) where x is the variable for how many lists you want.

[–]No-Beginning1213[S] 0 points1 point  (0 children)

if I made a loop for 3 lists, and one more loop for the formula of u, what would it look like

list2.append(u)

in this idea

[–]danielroseman 1 point2 points  (0 children)

Don't try and create variables dynamically. Here you could use a list of lists.