Cheatography
https://cheatography.com
When dealing with strings in python, there is a very helpful standard module : string.py.
String module contains some constants, utility function, and classes for string manipulation.
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Constants : ascii_letters
import string
all_letters = string.ascii_letters
print(all_letters)
|
output :
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
|
Constants : ascii_lowercase OR ascii_uppercase
import string
lower_letters = string.ascii_lowercase
upper_letter = string.ascii_uppercase
print (lower_letters, upper_letter, sep = "\n")
|
Output :
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
|