if i have a string, let's say its
xx = 'abc123def456gh i"
i'm having problems figuring out a way to know if xx[0] is a letter or number, then check xx[1] for the same thing and so on and so forth.
what i thought would be easiest is doing somethign through regex
have
pattern1 = re.compile('[a-z]')
pattern2 = re.compile('[0-9]')
can i make a loop that check something like...
xx = 'abc123def456gh i"
i'm having problems figuring out a way to know if xx[0] is a letter or number, then check xx[1] for the same thing and so on and so forth.
what i thought would be easiest is doing somethign through regex
have
pattern1 = re.compile('[a-z]')
pattern2 = re.compile('[0-9]')
can i make a loop that check something like...
Code:
j = 0 while j < len(xx): if j == pattern1: print "its a letter"
Comment