Snippets

Page content

Open file with with statement

with open("path/to/file", "r") as in_file
  blabla...

Loop with index

words = ["You", "are", "a", "genious", "!"]
for i,word in enumerate(words):
    print(f"{i:{10}}{word:{12}}")

Exit loop

break