May-19-2020, 10:53 AM
You are getting lists when you want to get elements. a = ['one', 'two', 'three'] b = a[0:1] # Gets a list c = b[0:2] # Gets a list x = a[0] # Gets a string from the list y = x[:2] # Gets a substring from the string print(b, c, x, y)
Output:['one'] ['one'] one on