Generating a random email using python 3.2
Question: I would like to generate a 64 letter for a random email. There are a few
restriction so as to follow the email syntax. But I am not sure why doesnt my
output display anything. Is there something wrong with my if statement?

    
    
    import random
    y=" "
    for x in range (0,64): 
         z = random.randint(33,127)
         if z in [32,34,40,41,44,58,59,60,62,64,91,92,93] == False:
              b = chr(z)
              print(b)
    


Answer: This:

    
    
    if z in [32,34,40,41,44,58,59,60,62,64,91,92,93] == False:
    

is equivalent to:

    
    
    if z in [32,34,40,41,44,58,59,60,62,64,91,92,93] and [32,34,40,41,44,58,59,60,62,64,91,92,93] == False:
    

which never evaluates to True, you probably meant to do:

    
    
    if z not in [32,34,40,41,44,58,59,60,62,64,91,92,93]:
    

