Choose three different values from list in Python
Question: I have a list of points with their coordinates, looking like this:

    
    
    [(0,1),(2,3),(7,-1) and so on.]
    

What is the Pythonic way to iterate over them and choose three different every
time? I can't find simpler solution than using three `for` loops like this:

    
    
    for point1 in a:
        for point2 in a:
            if not point1 == point2:
            for point3 in a:
                if not point1 == point3 and not point2 == point3:
    

So I'm asking for help.


Answer: 
    import random
    
    lst = [(0, 1), (2, 3), (7, -1), (1, 2), (4, 5)]
    
    random.sample(lst, 3)
    

This will just give you 3 points chosen at random from the list. It seems you
may want something different. Can you clarify?

