From the course: Dynamo for Revit: Python Scripting
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Logical operators
From the course: Dynamo for Revit: Python Scripting
Logical operators
- [Instructor] While comparison operators are good at comparing values, logical operators allow us to compare booleans. This becomes very useful when comparing two or more different value comparisons. So, for example, say we had a sphere in Dynamo, and we wanted to check if the sphere's radius was above a certain number, but also positioned above a particular Z-value, we could check both of these conditions at once to see if they were either both true or both false using logical operators. So let's start by having a look at the AND operator. AND operators are useful if you want to check if two boolean operations, or 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 to true. If we compare these two operations, we're essentially comparing true AND true, as both are equal to true, and therefore the result will equal true, as when comparing two booleans with the AND…
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
-
-
-
-
Defining variables6m 26s
-
(Locked)
Numbers7m 40s
-
(Locked)
Strings7m 11s
-
(Locked)
Working with lists6m 22s
-
(Locked)
Making decisions with conditionals7m 48s
-
(Locked)
Control with operators5m 46s
-
(Locked)
Logical operators7m 14s
-
(Locked)
Looping with the for loop5m 17s
-
(Locked)
Looping with the while loop6m 22s
-
(Locked)
Break and continue3m 15s
-
(Locked)
Nested loops6m 20s
-
(Locked)
Dictionaries4m 42s
-
(Locked)
Try and except3m 55s
-
(Locked)
Defining functions6m 7s
-
-
-
-