Skip an iteration while looping through a list - Python
Question: Is there a way to skip the first iteration in this for-loop, so that I can put
a for-loop inside a for-loop in order to compare the first element in the list
with the rest of them.

    
    
    from collections import Counter
    vowelCounter = Counter()
    vowelList = {'a','e','i','o','u'}
    userString = input("Enter a string ")
    displayed = False
    for letter in userString:
        letter = letter.lower()
        if letter in vowelList:
            vowelCounter[letter] +=1
        for vowelCount1 in vowelCounter.items():
            char, count = vowelCount1
            for vowelCount2 in vowelCounter.items(STARTING AT 2)
                char2, count2 = vowelCount2
                if count > count2 : CONDITION
    

How would the syntax go for this? I only need to do a 5 deep For-loop. So the
next would Start at 3, then start at 4, then 5, the the correct print
statement depending on the condition. Thanks


Answer: You could do:

    
    
    for vowelCount2 in vowelCounter.items()[1:]:
    

This will give you all the elements of `vowelCounter.items()` except the first
one.

The `[1:]` means you're slicing the list and it means: start at index `1`
instead of at index `0`. As such you're excluding the first element from the
list.

If you want the index to depend on the previous loop you can do:

    
    
    for i, vowelCount1 in enumerate(vowelCounter.items()):
        # ...
        for vowelCount2 in vowelCounter.items()[i:]:
            # ...
    

This means you're specifying `i` as the starting index and it depends on the
index of `vowelCount1`. The function `enumerate(mylist)` gives you an index
and an element of the list each time as you're iterating over `mylist`.

