Ron Adam <[EMAIL PROTECTED]> writes: > All of the following get the center 'd' from the string. > > a = 'abcdefg' > print a[3] # d 4 gaps from beginning > print a[-4] # d 5 gaps from end > print a[3:4] # d > print a[-4:-3] # d > print a[-4:4] # d > print a[3:-3] # d > print a[3:2:-1] # d These are symetric?! > print a[-4:-5:-1] # d > print a[3:-5:-1] # d > print a[-4:2:-1] # d
+1 QOTW -- http://mail.python.org/mailman/listinfo/python-list