Write the python program, which prints the following sequence of values in loops:
18,-27,36,-45,54,-63
n = 0
for i in range(0, 6):
if i%2 == 0:
n += 18
print(n, end=',')
elif i != 5:
print(n - (2*n) - 9, end=',')
else:
print(n - (2*n) - 9)
Comments
Leave a comment