Python offers two different loop types to iterate through data. With an understanding of the for loop, learn how the while loop works.
- [Instructor] The while loop is the second…of two loops available to us in Python.…Unlike the for loop,…the while loop will loop until a condition is false.…Think of a while loop like a set of traffic lights.…While the light is green,…traffic will continue to drive through…until a condition tells it to stop,…such as a red light.…This is how a while loop works.…It will continue to execute a set of instructions…until a certain condition tells it to stop.…Let's say, for example,…we had a variable named Var which equaled zero.…For a while loop, we need a condition.…
Say, while less than five.…This is the condition that will tell the loop to stop.…While Var is less than five, the while loop will run,…executing whatever is written within the loop.…Therefore, the Var variable needs to increment,…meaning it needs to increase with each loop…or the loop will continue to execute with no end…causing Dynamo to crash.…So, for example, if we increment the variable…by one for each loop,…the loop will run five times…before ending when the condition is no longer true.…
Note: This course uses Dynamo 1.3.1 and Revit 2018. For best results, it helps to have the same versions of the software.
- Importing the Dynamo Geometry library
- Defining variables
- Making decisions with conditionals
- Controlling flow with operators
- Defining functions
- Working with external libraries in Python
- Accessing the Revit API with Python
Skill Level Beginner
1. Dynamo and Python
2. Python Basics
3. Working with Libraries
4. Revit API
Next steps2m 18s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.