Archives de
Tag: module string

Le module STRING, ses constantes et sa méthode format ( )

Le module STRING, ses constantes et sa méthode format ( )

Pour plus d’infos, voir la documentation officielle : ici Les constantes : ascii_letters = ‘abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ’ ascii_lowercase = ‘abcdefghijklmnopqrstuvwxyz’ ascii_uppercase = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’ digits = ‘0123456789’ hexdigits = ‘0123456789abcdefABCDEF’ octdigits = ‘01234567’ printable = ‘0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU… C’est une combinaison des digits, ascii_letters, punctuation et whitespace punctuation = ‘! »#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~’ whitespace = ‘ \t\n\r\x0b\x0c’ >>> import string >>> string.digits ‘0123456789’ >>> phrase = « Je suis né le 15 août 1769″ >>> for lettre in phrase : print (lettre, end =  » « ) if lettre in…

Lire la suite Lire la suite