john-science / python_for_scientists

Python Open Courseware for Scientists and Engineers
GNU General Public License v3.0
68 stars 40 forks source link

Trouble with Boolean in "01_basic_syntax/problem_set_1_variables.md" #57

Closed maybuhleen closed 6 years ago

maybuhleen commented 6 years ago

Under "Boolean Relationships", the following throws a TypeError: dist < (10 + 2j)

"dist" is defined as a float (4.9) in the previous lines.

Would we want to compare the real component of the complex number instead? dist < (10 + 2j).real

john-science commented 6 years ago

That's a fair point. I didn't actually think of the results of people were to try and run those commands. I was just thinking of the boolean operators. So I made the examples executable and valid code. And they now cover a more complete set of boolean operators.