This is a companion discussion topic for the original entry at https://www.raywenderlich.com/7910496-programming-in-kotlin-fundamentals/lessons/20
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/7910496-programming-in-kotlin-fundamentals/lessons/20
Your do-while loop did not print the first name in the array. Your check for index in the while condition should be index >= 0, not index > 0.
2 Likes
Hey @marathoner1234!
Good catch! I missed that bit when I wrote the condition.
Thanks for noticing and letting us know!
Your list has 6 elements, but your output has 5 element.
You are missing to print first element of list.
So index >= 0
, not index > 0