Skip to content

Instantly share code, notes, and snippets.

@zhuifengshen
Created November 22, 2018 08:12
Show Gist options
  • Save zhuifengshen/9d3e1e095084e6b98d08eb848bcecc75 to your computer and use it in GitHub Desktop.
Save zhuifengshen/9d3e1e095084e6b98d08eb848bcecc75 to your computer and use it in GitHub Desktop.
列表递归获取个数
def count(lst):
if lst == []:
retrun 0
else:
return 1 + count(lst[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment