how to get the first two characters of a string in python code example Example: string pick the first 2 characters python t = "your string" t[:2]