Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

python programming

+1 vote
asked Mar 16, 2020 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, 2020 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.
...