• + 0 comments

    The condition check

    if((y)<=len(list)) will always return true since len(list)==n+1 to start with and hence redundant. This condition makes more sense if len(list)==n. This code will work perfectly fine though, just pointing out in case someone is confused regarding why this condition check is there.