fork download
  1. f=lambda s,c,v='aeiou':[["l'",'il','lo'],['gli','i','gli'],["l'",'la','la'],['le']*3][c][[[1,2][s[0]=='s'and s[1]not in v or s[0]in'zx'or s[:2]in['gn','pn','ps']or s[0]=='i'and s[1]in v],0][s[0]in v and not(s[0]=='i'and s[1]in v)]]+' '+s
  2.  
  3. print(f('macchina',2),
  4. f('zio',0),
  5. f('libri',1),
  6. f('ieri',0),
  7. f('aquile',3),
  8. f('spagnoli',1),
  9. f('golf',0),
  10. f('ombra',2),
  11. f('impossibili',1),sep='\n')
Success #stdin #stdout 0.03s 9936KB
stdin
Standard input is empty
stdout
la macchina
lo zio
i libri
lo ieri
le aquile
gli spagnoli
il golf
l' ombra
gli impossibili