Lets say I have a string that consists of x unknown chars. How could I get char nr. 13 or char nr. x-14?
This should further clarify the points:
a = int(raw_input('Enter the index')) str1 = 'Example' leng = len(str1) if (a < (len-1)) and (a > (-len)): print str1[a] else: print('Index overflow')
Input 3 Output m
Input -3 Output p