elif in list
Is it possible to use a recursive list. My problem is that I can code a list with an if condition. But I have not found the way to insert inside a list an elif
.
For instance in pur Python to code x[t] = a x[t-1] + b, x[0] given
is coded without any difficulties. But what I search is the list way as in Mathematica (<- I know my mother often told me not tell swear words).
In fact I have two problems the first is purely recursive like mathematica code
RecurrenceTable[{a[n + 1] == 3 a[n], a[1] == 7}, a, {n, 1, 10}]
here the if
condition would be some thing like
A=[a[n + 1] == 3 a[n] for i in range(10) if n > 1 elif : a[n] == 7 if n in range(0)]
but also
A=[something(i) for i in range(..) if condition1 on something(i) elif condition2 on something(i)]
Please add code that you wish would work but does not work.
From there it should be possible to explain why it does not work and how to achieve the desired result.
Or add Mathematica code and hopefully someone can translate.
From what I understand the Wolfram Language is publicly specified.