lis = [] for i in xrange(2, 101): for j in xrange(2, 101): tmp = i ** j if lis.count(tmp) == 0: lis.append(tmp) print len(lis)