{"id":2987,"date":"2023-10-19T09:44:45","date_gmt":"2023-10-19T04:14:45","guid":{"rendered":"https:\/\/python-programs.com\/?p=2987"},"modified":"2023-11-10T11:48:32","modified_gmt":"2023-11-10T06:18:32","slug":"basics-of-python-string-constants","status":"publish","type":"post","link":"https:\/\/python-programs.com\/basics-of-python-string-constants\/","title":{"rendered":"Basics of Python \u2013 String Constants"},"content":{"rendered":"
In this Page, We are Providing Basics of Python \u2013 String Constants. Students can visit for more Detail and Explanation of Python Handwritten Notes<\/a>\u00a0Pdf.<\/p>\n String constants<\/strong><\/p>\n Some constants defined in the string module are as follows:<\/p>\n string. ascii_lowercase string. ascii_uppercase string. ascii_letters string. digits String.hex digits string.octdigits string. punctuation >>> string.punctuation string. whitespace >>> string.whitespace string. printable In this Page, We are Providing Basics of Python \u2013 String Constants. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Basics of Python \u2013 String Constants String constants Some constants defined in the string module are as follows: string. ascii_lowercase It returns a string containing the lowercase letters ‘ abcdefghijklmnopqrstuvwxyz ‘. …<\/p>\nBasics of Python \u2013 String Constants<\/h2>\n
\nIt returns a string containing the lowercase letters ‘ abcdefghijklmnopqrstuvwxyz ‘.<\/p>\n>>> import string\r\n>>> string . ascii_lowercase\r\n' abcdefghijklmnopqrstuvwxyz '<\/pre>\n
\nIt returns a string containing uppercase letters ‘ ABCDEFGHIJKLMNOPQRSTUVWXYZ ‘.<\/p>\n>>> string . ascii_uppercase \r\n' ABCDEFGHIJKLMNOPQRSTUVWXYZ '<\/pre>\n
\nIt returns a string containing the concatenation of the ascii_lowercase and ascii_uppercase constants.<\/p>\n>>> string . ascii_letters\r\n' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '<\/pre>\n
\nIt returns the string containing the digits ‘ 0123456789 ‘.<\/p>\n>>> string.digits \r\n' 0123456789 '<\/pre>\n
\nIt returns the string containing hexadecimal characters ‘ 0123456789abcdef ABCDEF ‘.<\/p>\n>>> string.hexdigits \r\n' 0123456789abcdef ABCDEF \u2019<\/pre>\n
\nIt returns the string containing octal characters ‘ 01234567 ‘.<\/p>\n>>> string.octdigits \r\n' 01234567 '<\/pre>\n
\nIt returns the string of ASCII characters which are considered punctuation characters.<\/p>\n
\n‘ ! ” # $ % & \\ ‘ ( ) * + , – . \/ : ; <=> ? @ [ \\\\ ] \u2227 _ ‘ { | } \u223c ‘<\/p>\n
\nIt returns the string containing all characters that are considered whitespace like space, tab, vertical tab, etc.<\/p>\n
\n‘ \\ t \\ n \\ x0b \\ x0c \\ r ‘<\/p>\n
\nIt returns the string of characters that are considered printable. This is a combination of digits, letters, punctuation, and whitespace.<\/p>\n>>> string . printable\r\n' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ! \" # $ % & \\ ' ( ) * + , - . \/ : ; <=> ? 0 [ \\\\ ]\u2227 _ ' { I \\ t \\ n \\ r \\ x0b \\ x0c\u00a0 '<\/pre>\n
Python String Programs<\/h3>\n
\n