Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # if you want to iterate over multiple ranges/lists in sequence:
- for i in range(0, 180, 45):
- print(i)
- for i in range(180, 0, -45):
- print(i)
- for i in [0]:
- print(i)
- # use the "chain" function from itertools to combine the ranges/lists:
- from itertools import chain
- for i in chain( range(0, 180, 45), range(180, 0, -45), [0] ):
- print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement