Skip to content

Instantly share code, notes, and snippets.

@mclavan
Created July 3, 2022 14:00
Show Gist options
  • Save mclavan/01b44e36e7b06197969aa5c93b84e5f1 to your computer and use it in GitHub Desktop.
Save mclavan/01b44e36e7b06197969aa5c93b84e5f1 to your computer and use it in GitHub Desktop.
Loops - Using the range command
'''
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