How do I compare two strings using a for loop?
17:31 27 Jan 2015

I'm building a simple email verifier. I need to compare the local-parts current letter to a list of valid characters. So essentially I'm asking how do I check to see if the current letter I'm on in local-part is equivalent to a letter in the ENTIRE list of valid chars. If it is a valid character, local-part will go to the next letter in its string and go through the list of valid characters to see if this too is and so on until it reaches the @ symbol unless there isn't a valid character.

I'm fairly new to python so I don't know how nested for loops work.

for ch in local:
    for ch in valChar:
    if(ch ==ch) <----problem

This is what I currently have written for the loops. Is "ch" a variable or some type of syntax to represent char?

python