I have a function that return or should return all the rows selected from a database table. However, it returns only the first rows. I don't quite understand why the rest rows are not returned when i use the 'return' keyword. The code is a bit long, so i'm including a sample code which is a bit similar terms of functionality. I believe if i can get a fix for this, i should be able to fix the one in the main code. My sample code is below. In this code, only the color yellow is printed. Please anybody know why?
def color_choser():
colors = 'yellow', 'green', 'orange', 'blue', 'white', 'pupple', 'red', 'mangenta'
for color in colors:
return color
print(color_choser())