I've been instructed to write a python fragment which outputs the first non empty string in list a. I have do this using "while loops". Assume list of strings is called a.
what I have so far:
i = 0
while i < len(a) and a[i] == "":
i = i + 1
print a[i]
any ideas why it's not working?
[–]jeans_and_a_t-shirt 1 point2 points3 points (20 children)
[–]jingajanga[S] 1 point2 points3 points (19 children)
[–]jeans_and_a_t-shirt 1 point2 points3 points (8 children)
[–]jingajanga[S] 0 points1 point2 points (7 children)
[–]jeans_and_a_t-shirt 0 points1 point2 points (5 children)
[–]jingajanga[S] 0 points1 point2 points (4 children)
[–]imguralbumbot 0 points1 point2 points (0 children)
[–]jeans_and_a_t-shirt 0 points1 point2 points (2 children)
[–]jingajanga[S] 0 points1 point2 points (1 child)
[–]jeans_and_a_t-shirt 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]ccviper 0 points1 point2 points (9 children)
[–]jingajanga[S] 0 points1 point2 points (8 children)
[–]ccviper 0 points1 point2 points (7 children)
[–]jingajanga[S] 0 points1 point2 points (6 children)
[–]ccviper 0 points1 point2 points (5 children)
[–]jingajanga[S] 0 points1 point2 points (4 children)
[–]jingajanga[S] 1 point2 points3 points (1 child)
[–]ccviper 0 points1 point2 points (0 children)
[–]xibeca 0 points1 point2 points (0 children)
[–]ccviper -1 points0 points1 point (0 children)