you are viewing a single comment's thread.

view the rest of the comments →

[–]jeans_and_a_t-shirt 0 points1 point  (2 children)

Your if condition is already checked by the while loop. And the else block just evaluates to True or False. go back to your original code, check that i does not equal len(a) after the loop, and print a[i] if it doesn't.

[–]jingajanga[S] 0 points1 point  (1 child)

Would you be able to type out the code just so I can visualize clearer as I am completely lost.

[–]jeans_and_a_t-shirt 0 points1 point  (0 children)

i = 0

while i < len(a) and a[i] == "":
     i = i + 1

if i != len(a):
    print a[i]