Computer Science, asked by sudiptavijay04, 7 months ago

Write a program in python to print the following series - 1 -4 7 -10 13 -16 19 -22 25 -28 31 -34 37 -40

Answers

Answered by saranshsharma255
1

Answer:

for a in range (14):

   sign = 1

   if (a%2 ==2):

       sign = -1

   print (int(sign) * int(a))

   a += 3

so the main thing going on in the series is that we are adding 3 to the numbers starting from 1 but every second number in the list is negative.

i have not tested this code, there can be slight indentation errors, but it will do the trick

brainly my answer if you find it helpful

Similar questions