('FizzBuzz'[4*bool(n%3):4+4*bool(not n%5)] or n for n in itertools.count())
per quella delle lettere: set(frase) == set(list(map(chr, range(97, 123)))) p.s: itertools.count l'ho copiato da Carlo Miron :P Il giorno 7 settembre 2017 11:13, Pietro Brunetti <gunzap...@gmail.com> ha scritto: > Una domanda carina (che mi hanno fatto) è scrivere una funzione che > controlli che in una frase ci siano tutte le lettere dell'alfabeto. > > Comunque dovremmo davvero organizzare più spesso un po' di code-fu in lista > > SPOILER > La soluzione migliore passa per i set > > > > Il giorno 7 settembre 2017 11:02, Carlo Miron <mi...@python.it> ha > scritto: > >> 2017-09-07 0:58 GMT+02:00 Karim <lemieli...@gmail.com>: >> >> > 2017-09-06 8:25 GMT+10:00 Riccardo Magliocchetti >> > <riccardo.magliocche...@gmail.com>: >> >> >> >> Nel primo caso per profili junior anni fa chiedevo tra le altre queste >> >> due: >> >> - quale linguaggi conosci di più e quanto bene da 1 a 10 >> >> - fizzbuzz in che linguaggio preferisci >> > >> > Fantastico, non conoscevo fizzbuzz. Ho provato a farlo e ho salvato la >> > faccia, allora ho proposto lo stesso esercizio sul gruppo facebook... >> > diciamo che ha acceso gli animi :D >> >> E così parte il golfing sulla soluzione più breve. la mia è >> >> ("Fizz"*(not x%3)+"Buzz"*(not x%5) or x for x in itertools.count(1)) >> >> :P >> >> ㎝ >> >> -- >> |:**THE 🍺-WARE LICENSE** *(Revision ㊷)*: >> | <miron@🐍.it> wrote this mail. As long as you retain this >> | notice you can do whatever you want with this stuff. >> | If we meet some day, and you think this stuff is worth it, >> | you can buy me a 🍺 in return. —㎝ >> _______________________________________________ >> Python mailing list >> Python@lists.python.it >> https://lists.python.it/mailman/listinfo/python >> > > > > -- > There is a crack, a crack in everything. That’s how the light gets in > L. Cohen > > _______________________________________________ > Python mailing list > Python@lists.python.it > https://lists.python.it/mailman/listinfo/python > >
_______________________________________________ Python mailing list Python@lists.python.it https://lists.python.it/mailman/listinfo/python