Created
July 3, 2022 14:00
-
-
Save mclavan/01b44e36e7b06197969aa5c93b84e5f1 to your computer and use it in GitHub Desktop.
Loops - Using the range command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Renaming Padding Systems | |
Loops - using the range command | |
''' | |
print('Using Range.') | |
# for loop using range | |
for i in range(10): | |
print(i) | |
''' | |
print('Range using a start and stop.') | |
# defining a range | |
for i in range(5, 10): | |
print(i) | |
print('Range using a step.') | |
# defining a step | |
for i in range(0, 10, 2): | |
print(i) | |
# Getting the length of a list | |
control_system = pm.ls(sl=True) | |
print('Control System length:', len(control_system)) | |
for i in range(0, len(control_system), 2): | |
print(i) | |
''' | |
''' | |
# Using the dag flag | |
control_system = pm.ls(sl=True, dag=True) | |
print('(DAG) - Control System length:', len(control_system)) | |
for i in range(0, len(control_system), 3): | |
print(i) | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment