NightShadeQueen's user avatar
NightShadeQueen's user avatar
NightShadeQueen's user avatar
NightShadeQueen
  • Member for 8 years, 5 months
  • Last seen more than 5 years ago
Stats
3,284
reputation
472k
reached
92
answers
1
question
Loading…
About

What happens when you learn python by doing as much of project euler as possible with oneliners.

def nCk(n,k): return int(round(reduce(mul, (float(n-i)/(i+1) for i in range(k)), 1)))

def eul29(): return len(set([a**b for a in range(2, 101) for b in range(2, 101)]))

def eul30():
     def fifth(n): return sum([int(i)**5 for i in str(n)])
     return sum([fifth(i) for i in range(2,355000) if  fifth(i) == i])

def eul56():
     return max([sum([int(i) for i in str(a**b)]) for a in range(90,101) for b in range(90,101)])

Biologist by day, decisively not a programmer by night, I swear.

3
gold badges
24
silver badges
37
bronze badges
214
Score
86
Posts
92
Posts %
39
Score
13
Posts
14
Posts %
14
Score
10
Posts
11
Posts %
13
Score
5
Posts
5
Posts %
6
Score
5
Posts
5
Posts %
5
Score
3
Posts
3
Posts %