while len(mylist) > 0:
print mylist.pop()
You are not iterating over the list. You are each time checking an atomic condition.
Also:
while len(mylist) > 0:
can be rewritten as:
while len(mylist):
which can be rewritten as:
while mylist:
More Related Contents:
- Shuffling a list of objects
- Pandas column of lists, create a row for each list element
- What is the difference between `sorted(list)` vs `list.sort()`?
- What do ellipsis […] mean in a list?
- How can I get list of values from dict?
- Converting a string representation of a list into an actual list object [duplicate]
- Apply function to each element of a list
- Python list rotation [duplicate]
- List on python appending always the same value [duplicate]
- Python assigning multiple variables to same value? list behavior
- Convert NumPy array to Python list
- why sum on lists is (sometimes) faster than itertools.chain?
- First Python list index greater than x?
- Wrapping around on a list when list index is out of range
- Is it possible to get a list of keywords in Python?
- Tuple or list when using ‘in’ in an ‘if’ clause?
- Get number of items from list (or other iterable) with certain condition
- Some built-in to pad a list in python
- Remove duplicates and original from list
- Python – sum values in dictionary
- Sliding window maximum in O(n) time
- Convert list into a pandas dataframe
- Why do these list methods (append, sort, extend, remove, clear, reverse) return None rather than the resulting list?
- Sorting list according to corresponding values from a parallel list [duplicate]
- Appending to list in Python dictionary [duplicate]
- Does Python have an immutable list?
- Swap values in a tuple/list inside a list in python?
- What is the cost/ complexity of insert in list at some location?
- Nested lambda statements when sorting lists
- Check list monotonicity