Let’s walk through your code and discuss it.
for i in list[numbers]:
list? You have a loop here that should be walking through the
numbers to get at each
number within that list. Think about it.
The loop before it gives you a list of numbers.
Loop 1 ->
numbers will be
[1, 2, 3].
In your second loop, you then want to iterate (loop) through each of the items in that new list of
Here, you’re using the variable parameter
lists as a function, i.e.
lists(). It’s not a function. Right? It’s a list of lists.
Once you rework your second
for loop as I mentioned above, you’ll get a single
number out of
numbers. It’s not a key. Rather, it’s a value. You want to append that value into your
Lastly with this one,
.append() is adding the new item into the list. It doesn’t return anything back as you are doing here
Look at the `return. It’s within the 1st loop. Is that when you want to return the results?