generate functionMon, 02 Jan 2023

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

def rainbow_colours colours = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'] colours.shuffle end rainbow_colours

Questions about programming?Chat with your personal AI assistant