Python String Cheat Sheet
Method Description capitalize() Converts the first character to upper case Usage: x = txt.capitalize() casefold() Converts string into lower case center() Returns a centered string Usage: x = txt.center(15, "-").…
Method Description capitalize() Converts the first character to upper case Usage: x = txt.capitalize() casefold() Converts string into lower case center() Returns a centered string Usage: x = txt.center(15, "-").…
RegEx Functions Function Description findall Returns a list containing all matches. Usage: x = re.findall(“search”, txt) search Returns a Match object if there is a match anywhere in the string…
if condition: Do this…elif condition: Do Thatelse: Do That Shorthandif condition: do that For Loops While Loops
List: Ordered, indexed, changeable, and allow duplicate values.List= Tuple: Ordered, unchangeable, and allow duplicate values.Tuple= (“a”, “b”, …) Set: Unordered, unchangeable, and disallow duplicate values.Set= {“a”, “b”, …} Dictionary: Ordered,…
pip install SpeechRecognition brew install portaudio pip install pyaudio