EvaluationTotal: 10 points -3 points: for loop traversing by index; 3 points: wh
EvaluationTotal: 10 points -3 points: for loop traversing by index; 3 points: while loop; 3 points: 3 examples used to test your code, demonstrating the same outcome for all loops; 1 point: submission of file.
Convert this for loop, which traverses by element, into a for loop that traverses by index. Then convert it into a while loop. n is an integer of your choice and word is a variable assigned to a string. You will have to use string indexing.
for ch in word:
print(ch * n)
Once you have written code for your loops, or as you’re developing them, choose three examples to demonstrate that all of the loops are result in the same outcome. You should use three different words and potentially three different values of n, whatever you choose!
Write this in a script called traversing_strings.py and attach that file to your discussion post.
You are not required to respond to anyone this week, but I encourage you to do so!
You must start a thread before you can read and reply to other threads