I would like to know if there is a way to create a recursion directly in a list. The following command doesn't work

```
h=[0 if (i<1) else h[i-1] + 1 for i in range(10) ]
```

1 | initial version |

I would like to know if there is a way to create a recursion directly in a list. The following command doesn't work

```
h=[0 if (i<1) else h[i-1] + 1 for i in range(10) ]
```

I would like to know if there is a way to create a recursion directly in a list. The following command doesn't work

```
f(x) = -(x-4)^2+16
g(x) = f(x)-f(0)
d=[x for x in range(9)]
c= list(map_threaded(g,d))
s=[(c[i]-c[i-1])/d[i]-d[i-1] for i in range(1,len(c))]
g=[d[i]-d[i-1] for i in range(1,len(d))]
h=[0 if (i<1) else h[i-1] +
```~~1 ~~g[i] for i in ~~range(10) ~~range(len(d)-1) ]

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.