Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Dec 11th, 2017
77
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.17 KB
| None
|
0
0
raw
download
clone
embed
print
report
def nested_sum(x):
return sum(numbers(x))
def numbers(xs):
if isinstance(xs, array):
yield from itertools.chain(numbers(x) for x in xs)
else:
yield xs
Add Comment
Please,
Sign In
to add comment
Public Pastes
Practicality of life
R | 10 min ago | 9.94 KB
advanced_mega_registry_toggle
Python | 14 min ago | 8.39 KB
🤑 G2A.com Free Gift Card Guide Apr 2024 FIX 🤑
GetText | 17 min ago | 0.39 KB
Untitled
C++ | 1 hour ago | 0.40 KB
Elite:Dangerous: Titan-Bomber Script
Python | 1 hour ago | 6.10 KB
Kick Up Simulator Codes
JSON | 2 hours ago | 0.11 KB
Untitled
FreeBasic | 3 hours ago | 2.56 KB
idk
Lua | 5 hours ago | 130.01 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!