Sì, solo per una versione dell'alfabeto. O Maiuscolo o minuscolo. Per esempio """ In [1]: import string
In [2]: string.ascii_uppercase Out[2]: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' In [3]: every_uppercase_char = set(string.ascii_uppercase) In [4]: example = set("the quick brown fox jumps over the lazy dog".upper()) In [5]: not(every_uppercase_char - example) Out[5]: True In [6]: example2 = set("the quick brown fox jumps over the lazy do".upper()) # senza la 'g' In [7]: not(every_uppercase_char - example2) Out[7]: False """ Da notare che faccio la sottrazione in un verso per evitare problemi con la punteggiatura e gli spazi 2017-09-07 13:47 GMT+02:00 Michele Finelli <m...@pavis.biodec.com>: > * Andrea D'Amore (and.dam...@gmail.com) [170907 13:35]: > >> […] >> >>> La soluzione migliore passa per i set >>> >> >> Come: >> >> set('abcdefghijklmnopqrstuvwxyz') <= set(test_sentence) >> >> ? >> >> > non ci vuole anche un .lower() ? > > -- > .*. finelli > /V\ > (/ \) -------------------------------------------------------------- > ( ) Linux: Friends dont let friends use Piccolosoffice > ^^-^^ -------------------------------------------------------------- > > Am'ar'c'mand, fe` pulid. > > _______________________________________________ > 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