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:

1 num_rows = 2 2 num_cols = 3 3 Your solution goes

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

here'' 4 5 6 end=' ') 7 print('*', print('') = 0 1

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

1 Expert Approved Answer
Step: 1 Unlock

To solve these problems well write the code for each one separately 1 Print a ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

60961c69734b9_26615.pdf

180 KBs PDF File

Word file Icon

60961c69734b9_26615.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!