Python Forum

Full Version: Please Help with lists and loops
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Welcome!

Where do you need help? Show us what you did so far. Put your code between code tags.
Honestly i have no idea where to even start
We are willing to help but we won't write it for you.

Make a try.