|
Oktatás * Programozás 2 * Szkriptnyelvek * Adator. prog. Teaching • Prog. for Data Sci. Félévek Linkek * kalendárium |
Nim2 /
Character classesSometimes you need to work with the English alphabet, with digits, etc. Here I collect these character classes for reference. $ python3 Python 3.14.7 (main, Aug 10 2026, 07:46:56) [GCC 16.1.1 20260728] on linux >>> import string >>> >>> string.ascii_letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> >>> string.ascii_lowercase 'abcdefghijklmnopqrstuvwxyz' >>> >>> string.ascii_uppercase 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> >>> string.printable '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c' >>> >>> string.whitespace ' \t\n\r\x0b\x0c' >>> >>> string.digits '0123456789' >>> >>> string.octdigits '01234567' >>> >>> string.hexdigits '0123456789abcdefABCDEF' >>> >>> string.punctuation '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' But don't forget: in Nim, you can create sets easily: let lowercase = {'a'..'z'} alphabet = {'a'..'z', 'A'..'Z'} See here for more info about sets. |
![]() Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |