In: Computer Science
[PYTHON] How do you write a program that first gets a list of floating point numbers from input. The input begins with an integer indicating the number of numbers that follow. Then input all data values and store them in a list [PYTHON]
Thanks for the question.
Here is the completed code for this problem.
Comments are included, go through it, learn how things work and let me know if you have any doubts or if you need anything to change.
If you are satisfied with the solution, please rate the answer.
Thanks
===========================================================================
# ask for the count
num_count=int(input('Enter number of floating point numbers you like to enter: '))
float_num_list=[] # create an empty list
# run a for loop for count times
for i in range(1,num_count+1):
# ask user to enter floating number
num=float(input('Enter number {}: '.format(i))) # convert to float using float() function
float_num_list.append(num) # store it in the list
# display all the numbers one at a time
print('You entered')
for num in float_num_list:
print(num)

thanks a lot !
please do appreciate with a up vote : )