Series Printing in Python-1
Series Printing in Python-1
n=int(input())
sum=0
for i in range(1,n+1):
sum+=i
print("The sum of the series = ",sum)
n=int(input())
sum=0
i=1
while(i<=n):
sum+=i
i+=2
print("The sum of the series = ",sum)
3. Print the series like -1,4,-7,10, ------n term.
# iterate from 0 to N
for num in range(N):
else:
pass
# Driver code
if __name__ == "__main__":
# Calling function
result(N)