generate functionWed, 30 Nov 2022

create an array containing the colours of the rainbow, then print them in a random order

def rainbow(): colours = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'] for colour in colours: print(colour) rainbow()

Questions about programming?Chat with your personal AI assistant