and operator with random
Question: i dont understand why the code bellow doesnt work properly. If both variables
a and b < 0 it should print that both numbers are negative,else the last
message. But it just dont work so, what am i doing wrong? please help!

    
    
    import random
    while True:
        input()
        a=random.randint(-9,9)
        b=random.randint(-9,9)
        print(a,b)
        if a and b < 0:
            print("2 negative numbers:",a,b)
        else:
            print("one or both of the numbers are positive!")
    

I'm running this on python 3.4.


Answer: Evaluating Both Operands will resolve the issue. Here both Operands are
expressions which results in true or false, so if both result in true; you
will get your required result.

    
    
    if ((a < 0) and (b < 0)):
    

