Skip to main content

Python quick reference

Misc​

Exit a program​

import sys

sys.exit()

Strings​

String formatting​

'This is a string: {0}'.format('this too')

Lists (arrays)​

Get the length of a list​

len(mylist)