Welcome to programming in Python :) .
The syntax for getting a character out of the string s
is s[i]
where i starts with 0 and goes up to n-1 where n is the length of the string.
In Python it is possible to create a list of elements using a syntax that explains itself when reading it. item[1]
means in this context the second character/element in the string got from input because Python considers in this context a string to be a list of characters.
The right keywords to search the Internet for details will be "Python list comprehension" and "Python list slice".
output = [item[1] for item in input_] (see note in the other answer about 'input')
Compared to C++ Python will make coding a pleasure. You have just to write what you mean it has to be that way and it probably will be that way in Python - that is how I came from C++ to Python myself.