Robotics & Artificial Intelligence

Write Python code to display the first ten terms of the following series:

1, 2, 4, 7, 11, ……………

Python Control Flow

3 Likes

Answer

n = 1
for i in range(1, 11):
    print(n, end=" ")
    n = n + i

Output

1 2 4 7 11 16 22 29 37 46 

Answered By

1 Like


Related Questions