Hello,
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 !"
Hello,
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 !"
hi,
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,…
How about this?
How do you paste code with indents or did you have to do it manually?
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.
I explain a little about Python in this presentation: https://github.com/Amoursol/dynamoPython/wiki/Diving-Deeper:-A-Beginners-look-at-Python-in-Dynamo It should be useful conceptually!
Also, have a look at https://github.com/Amoursol/dynamoPython which is a repository of 60+ Dynamo Python graphs (You can copy paste into nodes) from the community.
And then check out https://dynamopythonprimer.gitbook.io/dynamo-python-primer/, an awesome resource by @oliver.green!
Ooooo… I didn’t know about dynamo python primer!!
Thankyou