python programming

+1 vote
asked Mar 16 by anonymous
Write a simple python function to generate a series of floating-point numbers by declaring and updating the global values of the variable and use it to produce the desired range of floating-point numbers by taking input from the user.Write a simple python function to generate a series of floating-point numbers by declaring and updating the global values of the variable and use it to produce the desired range of floating-point numbers by taking input from the user.

The required output is as:
Please input the starting for your series
Please input the d for your series
The series produced by this method is
0.25, 1.0, 1.75, 2.5, 3.25, 4.0, 4.75, 5.5, 6.25, 7.0,

1 Answer

0 votes
answered Mar 17 by anonymous
start=float(input("Please input the starting for your series:"))
dif=float(input("Please input the d for your series:"))
rang=float(input("Please input the range for your series:"))
item=[]
item.append(start)
i=rang
temp=start
while i>1:
    temp=temp+dif
    item.append(temp)
    i=i-1
print (item)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...