Question: This code doesn't work: lines=0 while lines Earworm.py Submit Run Grades Reset 1 lyrics = [I wanna be your endgame, I wanna be your first
This code doesn't work:
lines=0 while lines
Earworm.py Submit Run Grades Reset 1 lyrics = ["I wanna be your endgame", "I wanna be your first string", Console output will be displayed here I wanna be your A-Team", "I wanna be your endgame, endgame 3 lines_ of_sanity 6 5 You may modify the lines of code above, but don't move them 6 #Ahen you submit your code, we'll change these lines to 7 assign different values to the variables. 9 #Imagine you have a song stuck in your head. Worse, you have 10?only a few lines from a song stuck in your head. They just 11 keep repeating over and over. The specific lines you have 12 stuck in your head are stored in the variable lyrics. 13 14 You can only stay sane so long while doing this. 15 #8pecifically, you can only listen to lines-of-sanity lines 16 before going crazy. Once you've reached lines-of-sanity, 17 #your brain will finish out the current list, then crumble 18 # 19 Write some code that will print the lyrics that run through 20 #your head. It should keep repeating each line one-by-one 21 Wuntil you 've reached lines of_sanity 1ines. Then, it should 22 Wkeep going to finish out the current verse. After that, print 23 MAKE IT STOP" in all caps (without the quotes). 24 # 25?HINT: Remember, we can iterate through items in a list using 26 this syntax: 27 # 28 for item in listofitems: 29 30 HINT 2: You'll probably need a counter to count how many lines 31 ???have been printed so far. 32 - - 34 #Add your code here! Using the initial inputs from above, this 35 #should print 9 lines : all 4 lines of the list twice, followed 36 by MAKE IT STOP
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
