nice way to loop all 3 numbers of python list : let say I have a list A = [1,2,3,4]<br/>
I want to show the list [1,2,3] , [2,3,4] <br/> then here is my solution<br/>

    A= [5, 3, 3]


    def solution(A):
        A.sort()
        #print(A)
        for i in range(0,len(A)-2):
            if i+3 <= len(A):
                part = A[i:i+3]
                if part[0] + part[1] > part[2]:
                    print(part)
                    return 1

I used             if i+3 <= len(A):
condition to check length overflow. but I do not like <br/>
is there other nicer way to represent?