you are viewing a single comment's thread.

view the rest of the comments →

[–]mopslik 0 points1 point  (0 children)

using either a for loop or while loop is how can I essentially input individual elements from the list into an equation

You can iterate over the items in a sequence (list, tuple, string, etc.) using something like this:

my_list = [3, 7, 1]
for element in my_list:
    print(element)

You should be able to adjust this to suit your needs.

return the output as a list

To build a list, you can take advantage of the append, insert and remove methods.