Pythonic one-liner for populating a sequence
Say I want to calculate the first n Fibonacci numbers and put them into a list. With a ‘for’ loop, this is trivial. But is there a one-liner – a kind of list comprehension magic, perhaps – that could achieve this more elegantly?
From a user who feels pretty confident, but is always looking for the most Pythonic approach!