Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #5
  2. def nifsValidos(dicio):
  3. lista_chaves=[]
  4. for chave in dicio.keys():
  5. lista_chaves+=[str(chave)]
  6. for chave in lista_chaves:
  7. soma=0
  8. for i in range(9,0,-1):
  9. soma+=i*int(chave[9-i])
  10. if soma%11!=0:
  11. chave=int(chave)
  12. del dicio[chave]
  13. return dicio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement