Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def remove_e_conta(l,num):
- if l==[]:
- return [],0
- if l[0]==num:
- return remove_e_conta(l[1:],num)[0],remove_e_conta(l[1:],num)[1]+1
- return [l[0]]+remove_e_conta(l[1:],num)[0],remove_e_conta(l[1:],num)[1]
- l = [1,6,2,5,5,2,5,2]
- print "->", remove_e_conta(l,2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement