Skip to content
Advertisement

Is there a way to tranfer data from a function into a list?

I keep on trying to get the data from the function to display in the list, I’ve tried using list.append but I keep on getting errors, what am I doing wrong?

JavaScript

Advertisement

Answer

Your pick_up() function needs to return something. Since it can return either one or two students, you probably want it to return a list of either one or two students, and extend your picked_students list with that list.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement