Link to home
Create AccountLog in
Avatar of Noah
NoahFlag for Singapore

asked on

Content of the Tuple before Loops were executed

Hi experts,


So I recently came across this question while doing an online course and I am a bit lost on why there is a 5 and 8 in the options which I have to rearrange. 


User generated image

It would much appreciated if someone could help me solve this and explain why is it such :)

 


Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

I don't understand "why there is a 5 and 8 in the options"?

There is a 5 and 8 in the results from the loops so they have to be in myTuple, right?

As far as solving this:
First loop:
Start with the first item (zero based): 4
Move over two ( i = i + 2) and print the next:  8
Move over two more and print:  0
and so on for the next two...

Second loop:
Start with the second item in myTuple:  7
Move over two and print:  1
and so on
Avatar of Noah

ASKER

@slightwv (䄆 Netminder) Thank you for your reply! But I don't think that's right.. For the answers, 4 and 7 are already in the right position. As seen in the screenshot, it says "the first two have already been filled in for you". I have to rearrange 1, 8, 6, 5, 3, 9, 2, 0.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Noah

ASKER

Ohh! I see now. So that's what you meant.. I managed to get the right answer. It was 4,7,8,1,0,3,6,2,9,5.