Skip to content

Latest commit

 

History

History
executable file
·
56 lines (36 loc) · 768 Bytes

File metadata and controls

executable file
·
56 lines (36 loc) · 768 Bytes

String module - constants

Examples in Python 3

# Need to import module to get access to string
import string

"""
Letters
"""
# Upper and lower
print(string.ascii_letters)

# Lower
print(string.ascii_lowercase)

# Upper
print(string.ascii_uppercase)


"""
Numbers
"""
# Normal
print(string.digits)

# Hex
print(string.hexdigits)

# Octonal
print(string.octdigits)


"""
Other
"""
# Punctuation characters
print(string.punctuation)

Reference and read more

string — Common string operations

Revision history

2014-07-17 (sylvanas) PA1 First try.