How to make the join function join N amount of things?

I have a function ( f ) and if you put a number into it it gives a list based on that number. I need a way to put a list in ( L ) and it comes out with a joined version of that list. I know that the i could do join(f(1),f(2),f(3),f(4)…) ect but thats to always changing and very long and tedious. Any ideas?

You can use list comprehension like this.

I have a really similar problem, where f(n) takes in a list of points, and if they are above the x-axis, and places a square polygon at that point, and if they are below, it places a triangle. I’ve spent hours on this and couldn’t find a solution, as f(n) takes in a list of points, and outputs a separate list of polygons. Save my poor soul please?

something like this?
https://www.desmos.com/calculator/2kubmhk7e9

What kind of black magic did you use here- Oh my gosh thank you so much I had pretty much given up all hope for finding this myself. The internet always knows.

One more problem please… How would I get an arbitrary integer list like i=[4,2,3,1] to output [1…i]? ([1,2,3,4,1,2,1,2,3,1]). It’s like the first problem, but instead of doing the same operation to every index and adding it to the output list, it adds something of different length each time.

What do you mean by:

see next post …
////////

Ok, I think I understand what you want:

https://www.desmos.com/calculator/9xpqhwct7v

the solution relies on recursion.

Just out of curiosity:
speaking of recursion, it occurred to me that it is actually possible to
define functions without using any numbers directly, here’s an example:
Fibonacci numbers without numbers

Wait thats very cool
You did it from this right?

def fib(n):
     if n > 1:
         return fib(n-1) + fib(n-2)
     return 1

yes yes
\\\\\\\\\\\\ etc