id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

Boolean Expressionsandor7

prev  |  next  |  chance

Which order are the and and the or evaluated?

def andor5(val1, val2, val3):
    result = val1 or val2 and val3
    return result
Function Call  Return Value
andor5(True, True, True)
andor5(True, True, False)
andor5(True, False, True)
andor5(True, False, False)
andor5(False, True, True)
andor5(False, True, False)
andor5(False, False, True)
andor5(False, False, False)

Experiment with this code on Gitpod.io

⬅ Back