← Back to Loops
Question 381
Every Size In Every Colour
Every Size In Every Colour
Two colours are read, one per line, into a list; the sizes S, M and L are declared. Use nested for loops to print every size with every colour, one combination per line in the form <size> <colour>: the outer loop goes over the colours and the inner loop over the sizes, so the three sizes of the first colour are printed before any of the second colour. Input: two lines, no prompts.
Expected Output:
S red M red L red S blue M blue L blue
= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Loops
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.