From the course: Grasshopper and Rhino: Python Scripting
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Comparing with operators
From the course: Grasshopper and Rhino: Python Scripting
Comparing with operators
- [Instructor] In previous videos, we have used the equal to symbol to check the equality of two values. This is known as a Comparison Operator. Comparison Operators are useful for comparing one value to another. For example, if we wanted to compare the volume of two spheres, or the length of two lines, we would do so using a Comparison Operator. Let's have a look at some of the other Comparison Operators we can use. Before we do, however, let's have a quick look at the boolean data type, which I'm sure you've come across in Grasshopper. This simply contains a point driven by three sliders. For now, let's place a new Python component onto our canvas. And we'll double-click to open it up. A boolean is either one of two states, true or false. Think of this like a switch. The switch is either on, true, or off, false. To create a boolean, we simply assign to a variable true or false with a capitalized letter. For example, let's create two variables, T and F, and we'll assign to these the…
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
-
-
-
-