How to run it repetitive?


How can i make it repetive like “hip,hip,hurra” need i a empty list to append my strings?

for hurra_counter in range(1,4):
    for hip_counter in range(1,3):
	    OUT = "Hip"
    OUT = "Hurra !"


yes, you have to create a list before all the loops and then append strings to it.

x = []
a = []

for hurra_count in range(1,4):
    for hip_count in range(1,3):
	    OUT = "Hip"
	z = a.append(hip_count)
    OUT = "Hurra !"
    y = x.append(hurra_count)

    OUT = x,a

it is pit off,… :confused:


How about this?


How do you paste code with indents or did you have to do it manually?

1 Like

so it is no need to store the strings in a variable, i can append them direktly!

and the doubling of “x” doesn`t matter, because they are in 2 diferent loops?


I’ve only been learning Python for 2 months… So my understanding is very basic…

But x = [ ] creates a list.
I’m appending (adding to the end of the list, which I have called x) on each loop.

Hope this helps. :slight_smile:

1 Like

I explain a little about Python in this presentation: :slight_smile: It should be useful conceptually!

Also, have a look at which is a repository of 60+ Dynamo Python graphs (You can copy paste into nodes) from the community.

And then check out, an awesome resource by!


Ooooo… I didn’t know about dynamo python primer!!

Thankyou :slight_smile:

1 Like

You are most welcome @Alien! It’s a community creation by Oliver and super awesome :slight_smile:

1 Like