python get first 2 characters of string code example Example: string pick the first 2 characters python t = "your string" t[:2]