Python Cheet Sheet
Cheat Sheets

A quick cheatsheet on python operations Slice: astring = "Hello World" print(astring[3:7]) # prints-> lo w print(astring[0:10:2]) # skips one character, prints -> Hlowr print(astring[::-1]) # reverse a string using step -1 Case astring.upper() astring.lower() Slicing complete list performs a copy spam_copy = spam[:] Zip to loop furniture = ['table', 'chair', 'rack', 'shelf'] price = [100, 50, 80, 40] for item, amount in zip(furniture, price): print(f'The {item} costs ${amount}') Multiple assignments...

January 2, 2023