davegimo

Untitled

Feb 18th, 2021 (edited)
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. s = "haha federica ciao prova davide 33 55 423"
  2.  
  3. def removeVocale(s):
  4.     string = ""
  5.     for c in s:
  6.         if c not in "aeiouAEIOU":
  7.             string += c
  8.    
  9.     return string
  10.  
  11. def f(s):
  12.     l = s.split()
  13.     d = {}
  14.     for el in l:
  15.         if len(el) % 2 == 0:
  16.             s = removeVocale(el)
  17.             k = len(s)
  18.             if s.isdigit():
  19.                 k = int(s)
  20.                
  21.             d[s] = k
  22.  
  23.     print(d)
  24.  
  25. f(s)
Add Comment
Please, Sign In to add comment