From the course: Grasshopper and Rhino: Python Scripting
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Comparing Booleans
From the course: Grasshopper and Rhino: Python Scripting
Comparing Booleans
- In an earlier video, we learned how to use comparison operators to compare two different values. But what if we wanted to compare two booleans or boolean expressions to determine if they were true or false? We can with logical operators AND and OR, which allows to two boolean values. This becomes very useful when comparing two or more different comparison operations. So for example, say we had a box in Grasshopper and we wanted to check if the box's surface area was above a certain number, but also if it's volume did not exceed a certain value. We could check these two conditions at once to see if both were true or both were false using logical operators. Let's start with having a look at what the AND operator is. AND operators are useful if we want to check if two booleans are true. Say for example we had two operations. Two is greater than one, and one is less than five. As we have learned, both of these operations will equal true. If we compare these two operations, we're…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Variables6m 23s
-
(Locked)
Numbers7m 36s
-
(Locked)
Strings9m 16s
-
(Locked)
Lists and tuples9m 25s
-
(Locked)
Comparing with operators6m 23s
-
(Locked)
Making decisions with conditionals7m 48s
-
(Locked)
Comparing Booleans8m 42s
-
(Locked)
For loop7m 52s
-
(Locked)
While loop8m 43s
-
(Locked)
Nested loops5m 38s
-
(Locked)
Defining custom functions9m 45s
-
-
-
-