Project Euler #29: Distinct powers

  • + 1 comment
    L=[]
    N=int(input(""))
    if N>=2 and N<=10**5:
        for a in range(2,N+1):
            for b in range(2,N+1):
                c=a**b
                if c not in L:
                    L.append(c)
                else:
                    pass
        print(len(L))
    else:
        pass