RE: AP Computer Science - The Armstrong Numbers

You are viewing a single comment's thread from:

AP Computer Science - The Armstrong Numbers

in tutorials •  7 years ago 
[v for p,v in enumerate([sum([int(d)**len(str(i))for d in str(i)])for i in range(7**6)])if p==v]

The readability is lost, but it is even shorter.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
Loading...