127. Python Program to Compute the 1.0+1.1+1.2+1.3 + …… + 2.5 Series.
How does this program work?
- This program is used to find the Sum of the given series 1.0+1.1+1.2+1.3 + …… + 2.5 using Python.
- Declare variables sum and n and Initially initialize with 1.
- By using for loop we can find the sum of given series upto nth term.
Here is the code
n = float(input("Enter the number: "))
num = 0
i = float(1.0)
while i<=n:
num+=i
i+=0.1
print("Sum of the series: ",num)