Oct-27-2018, 06:11 AM
I'm having trouble with this homework and need help very desperately, been really confused on loops and lists.
Write a function that returns a list of numbers, make_list(). In the function, construct an empty list and then prompt the user to enter a number, -999 to quit. You will need a loop. If the user enters any number other than -999, add it to the list. Once the user enters -999, quit the loop and return the list. (Do not include -999 in the list.) Write another function that prints the elements of a list separated by a space ( print_elems(user_list) ). Call the functions appropriately.
Write a function that returns a list of numbers, make_list(). In the function, construct an empty list and then prompt the user to enter a number, -999 to quit. You will need a loop. If the user enters any number other than -999, add it to the list. Once the user enters -999, quit the loop and return the list. (Do not include -999 in the list.) Write another function that prints the elements of a list separated by a space ( print_elems(user_list) ). Call the functions appropriately.