Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
f=lambda s:s>''ands>[]and 10*ford(s[:-1])+ords.pop(s[-1]))-4848+10*f(s)
Try it online!Try it online!
-1 thanks to Sisyphus
-3 taking a list of characters as input thanks to ovs
f=lambda s:s>''and 10*f(s[:-1])+ord(s[-1])-48
Try it online!
f=lambda s:s>[]and ord(s.pop())-48+10*f(s)
f=lambda s:s!=''ands>''and 10*f(s[:-1])+ord(s[-1])-48
f=lambda s:s!=''and 10*f(s[:-1])+ord(s[-1])-48