Question: #Write a for - each loop that lists each character in #mystery _ string with its index. For example, if the string #was David, the

#Write a for-each loop that lists each character in #mystery_string with its index. For example, if the string #was "David", the output would be: #0 D #1 a #2 v #3 i #4 d # #Note that the first item is #0, the second is #1, and so #on! We'll talk about why that is in Unit 4. # #Hint: You'll need a separate variable to keep track of how #many letters you've printed! You may not use the range #function on this problem.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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

Students Have Also Explored These Related Programming Questions!