Question: 1. Write nested loops to print a rectangle. Sample output for given program: 2. Simon Says is a memory game where Simon outputs a sequence
1. Write nested loops to print a rectangle. Sample output for given program:

2. "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequence. Create a for loop that compares the two strings. For each match, add one point to user_score. Upon a mismatch, end the game. Ex: The following patterns yield a user_score of 4:
simonPattern: R, R, G, B, R, Y, Y, B, G, Y
userPattern: R, R, G, B, B, R, Y, B, G, Y

1 num_rows = 2 2 num_cols = 3 3 Your solution goes here'' 4 5 6 end=' ') 7 print('*', print('') = 0 1 user_score= 2 simon_pattern 3 user_pattern 4 = 'RRGBRYYBGY' 'RRGBBRYBGY' 5 ''Your solution goes here''' 6 7 print('User score:', user_score)
Step by Step Solution
3.38 Rating (157 Votes )
There are 3 Steps involved in it
To solve these problems well write the code for each one separately 1 Print a ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
60961c69734b9_26615.pdf
180 KBs PDF File
60961c69734b9_26615.docx
120 KBs Word File
