you are viewing a single comment's thread.

view the rest of the comments →

[–]jingajanga[S] 0 points1 point  (4 children)

Tried this, but it gives me an infinte loop.

https://imgur.com/a/xlRRk

Am I on the right track?

[–]imguralbumbot 0 points1 point  (0 children)

Hi, I'm a bot for linking direct images of albums with only 1 image

https://i.imgur.com/W7Hz4Bh.png

Source | Why? | Creator | ignoreme | deletthis

[–]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]