Search code examples
pythonlist-comprehension

List Comprehension starting at a specific number


I was trying to create this [80000, 104000, 135000...] list in Python. Its the value, starting at 80,000 multiplied by 1.3 each time I want

What i've tried:

a = [num*1.5 for num in ??? if num>=80000] #???--> i've tried range(10)

I should be able to do this but I can't find any solutions rn.. I must use list-comprehensions, if possible.

Some help would be nice, thank you!


Solution

  • There is a very basic mathematical operation that represents multiplying by the same value many time: power.

    a = [80000 * (1.3**n) for n in range(100)]