Post History
Python 3, 34 bytes f=lambda x:[f(y)for y in range(x)] Try it online! -9 bytes thanks to Moshi Unfortunately, I cannot use Python sets, because sets are unhashable and thus cannot be put int...
Answer
#2: Post edited
# [Python 3], 43 bytes- <!-- language-all: lang-python -->
f=lambda x:x and[f(y)for y in range(x)]or[][Try it online!][TIO-ko0e8puq]- [Python 3]: https://docs.python.org/3/
[TIO-ko0e8puq]: https://tio.run/##K6gsycjPM/7/P802JzE3KSVRocKqQiExLyU6TaNSMy2/SKFSITNPoSgxLz1Vo0IzNr8oOvY/SDgTIWxooGnFxVlQlJlXopGmkamp@R8A "Python 3 – Try It Online"- Unfortunately, I cannot use Python sets, because sets are unhashable and thus cannot be put into sets.
- # [Python 3], 34 bytes
- <!-- language-all: lang-python -->
- f=lambda x:[f(y)for y in range(x)]
- [Try it online!][TIO-krkpki3w]
- [Python 3]: https://docs.python.org/3/
- [TIO-krkpki3w]: https://tio.run/##K6gsycjPM/7/P802JzE3KSVRocIqOk2jUjMtv0ihUiEzT6EoMS89VaNCM/Y/SCgTIWRooGnFxVlQlJlXopGmkamp@R8A "Python 3 – Try It Online"
- -9 bytes thanks to Moshi
- Unfortunately, I cannot use Python sets, because sets are unhashable and thus cannot be put into sets.
#1: Initial revision
# [Python 3], 43 bytes <!-- language-all: lang-python --> f=lambda x:x and[f(y)for y in range(x)]or[] [Try it online!][TIO-ko0e8puq] [Python 3]: https://docs.python.org/3/ [TIO-ko0e8puq]: https://tio.run/##K6gsycjPM/7/P802JzE3KSVRocKqQiExLyU6TaNSMy2/SKFSITNPoSgxLz1Vo0IzNr8oOvY/SDgTIWxooGnFxVlQlJlXopGmkamp@R8A "Python 3 – Try It Online" Unfortunately, I cannot use Python sets, because sets are unhashable and thus cannot be put into sets.