get the first 10 characters of a string in python code example Example: python get first character of string string = 'This is a string' print(string[0]) #output: 'T'