Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 04/13/2018 - Okay, so I just had an amazing moment when I discovered a cool trick in python.
- # There is such a thing in Python called 'List Comprehention', which allows someone the ability
- # to loop through a multidimentional array in python
- # Keep in mind that this demonstration is in Python 3.
- #So, given a list:
- x = [[1,2,3],[1,2,3],[1,2,3]]
- #You can now loop through this list and print the fist index like so:
- loop = [iterator[0] for interator in x]
- print(loop)
- # Now, if you run this code, you will print out just the first index in the list
Add Comment
Please, Sign In to add comment