def max_cont_sub_array(mylist):
    max_end=0
    max_so_far=0
    print "List ", mylist
    for ind in range(len(mylist)):
        print ind , "-" , mylist[ind]
        max_end=max(mylist[ind],mylist[ind]+max_end)
        max_so_far=max(max_so_far,max_end)
    return max_so_far


if __name__=='__main__':
    mylst=[2,3,4,5,1,7,1]
    print max_cont_sub_array(mylst)
