Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's shorter in Python:

  sum(int(n) for n in input().split())
I'd argue it's an awful lot clearer, too.

Edit: A more functional version is shorter still, but I think not worth the readability cost:

  sum(map(int, input().split()))


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: