Game Development Reference
In-Depth Information
56. ('X' == 'O' and ' ' == 'O' and 'O' == 'O') or
57. (' ' == 'O' and 'X' == 'O' and 'O' == 'O') or
58. (' ' == 'O' and ' ' == 'O' and 'O' == 'O') or
59. ('X' == 'O' and 'X' == 'O' and 'O' == 'O') or
60. (' ' == 'O' and 'X' == 'O' and 'O' == 'O'))
Next, Python will evaluate all those == comparisons inside the parentheses to a boolean value:
53. return ((False and False and False) or
54. (False and False and False) or
55. (True and True and True) or
56. (False and False and True) or
57. (False and False and True) or
58. (False and False and True) or
59. (False and False and True) or
60. (False and False and True))
Then the Python interpreter will evaluate all those expressions inside the parentheses:
53. return ((False) or
54. (False) or
55. (True) or
56. (False) or
57. (False) or
58. (False) or
59. (False) or
60. (False))
Since now there is only one value inside the parentheses, we can get rid of them:
53. return (False or
54. False or
55. True or
56. False or
57. False or
58. False or
59. False or
60. False)
Now we evaluate the expression that is connecter by all those or operators:
53. return (True)
Search WWH ::




Custom Search