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 foreach loop that lists each character in #mysterystring with its index. For example, if the string #was "David", the output would be: # D # a # v # i # d # #Note that the first item is # the second is # and so #on We'll talk about why that is in Unit # #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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
