Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ActiveState/code
/ recipe-119029.py
File
recipe-119029.py
recipes/Python/119029_reverse_a_string/recipe-119029.py:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
f =
lambda
s:s and f(s[1:])+s[0]
2
#or
3
f =
lambda
s:reduce(
lambda
a,b:b+a,s,
''
)
4
#or
Callers
nothing calls this directly
Calls
7
list
Class · 0.85
f
Function · 0.50
extend
Method · 0.45
reverse
Method · 0.45
join
Method · 0.45
pop
Method · 0.45
append
Method · 0.45
Tested by
no test coverage detected