## The challenge

Complete the function that takes a non-negative integer `n` as input, and returns a list of all the powers of 2 with the exponent ranging from 0 to `n` (inclusive).

### Examples

 ``````1 2 3 `````` ``````n = 0 ==> [1] # [2^0] n = 1 ==> [1, 2] # [2^0, 2^1] n = 2 ==> [1, 2, 4] # [2^0, 2^1, 2^2] ``````

## The solution in Python code

Option 1:

 ``````1 2 3 4 5 `````` ``````def powers_of_two(n): out = [] for i in range(n+1): out.append(2**i) return out ``````

Option 2:

 ``````1 2 `````` ``````def powers_of_two(n): return [2**i for i in range(n+1)] ``````

Option 3:

 ``````1 2 `````` ``````def powers_of_two(n): return [1<

## Test cases to validate our solution

 `````` 1 2 3 4 5 6 7 8 9 10 `````` ``````import test from solution import powers_of_two @test.describe("Fixed Tests") def fixed_tests(): @test.it('Basic Test Cases') def basic_test_cases(): test.assert_equals(powers_of_two(0), [1]) test.assert_equals(powers_of_two(1), [1, 2]) test.assert_equals(powers_of_two(4), [1, 2, 4, 8, 16]) ``````