Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- Dic = {
- "Clave" : "Valor",
- "ClaveNumero2" : "Valor_numero2"
- }
- def espacios(valor,val=False):
- strvalor,strclave = [],[]
- for clave in valor:
- strvalor.append(len(valor[clave]))
- strclave.append(len(clave))
- if val:
- strvalor.sort()
- return (strvalor[len(strvalor)-1])
- else:
- strclave.sort()
- return (strclave[len(strclave)-1])
- print ("La string mayor de clave es : %d") %(espacios(Dic,False))
- print ("La string mayor de valor es : %d") %(espacios(Dic,True))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement