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,
Answers
tex
huge
bold
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 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,
tex
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 is as follows:
strt = float(input("Please input the starting for your series"))
dif = float(input("Please input the d for your series:"))
rag = float(input("Enter the range for the series:"))
num = []
print("The series produced by this method is")
num.append(strt)
i = rag
num = strt
while i > 1:
temp = temp + dif
num.append(temp)
i = i - 1
print (num)