Dremendo Tag Line

Print the number series 0 3 8 using while loop in Python

while Loop - Question 6

In this question, we will see how to print the number series 0 3 8 15... up to nth term in Python programming using while loop. To know more about while loop click on the while loop lesson.

Q6) Write a program in Python to print the number series given below using while loop.

0 3 8 15... up to nth term

Program

i=1
while i<=10:
    s=(i*i)-1
    print('%d ' %(s), end='')
    i=i+1

Output

0 3 8 15 24 35 48 63 80 99
video-poster