Here are some tips to help you figure it out.
To get one letter from the string index of a string.
>>> 'abcd'[2] 'c'
Note that the first character is the character zero, the second character is the character one, etc.
The next thing to note is that an uppercase letter does not compare with a lowercase letter:
>>> 'a' == 'A' False
Fortunately, python strings have upper and lower methods to change the string case:
>>> 'abc'.upper() 'ABC' >>> 'a' == 'A'.lower() True
Check us in :
>>> 3 in [1, 2, 3] True >>> 8 in [1, 2, 3] False
So, to solve your problem, bind the subscriber to get one upper / lower letter to set up the case, and testing for membership with in .
source share