In [1]: pets = [["Garfield", "cat", 4],["Dog", "dog", 7.5],["Porkey", "pig", 61],["Stoned", "rock", 0.230] ] In [2]: for pet in pets: ...: name, animal, weight = pet ...: print(name, animal, weight) ...: Garfield cat 4 Dog dog 7.5 Porkey pig 61 Stoned rock 0.23
Best form of iterating over a lsit of lists
Best form of iterating over a lsit of lists
|
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Split dict of lists into smaller dicts of lists. | pcs3rd | 3 | 2,539 |
Sep-19-2020, 09:12 AM Last Post: ibreeden |
|
Iterating through lists with different letter cases | fatherted99 | 2 | 1,947 |
Jun-07-2020, 01:22 PM Last Post: deanhystad |
|
sort lists of lists with multiple criteria: similar values need to be treated equal | stillsen | 2 | 3,416 |
Mar-20-2019, 08:01 PM Last Post: stillsen |
|
Iterating over two lists in python | dgm | 2 | 3,066 |
Jul-24-2018, 08:31 PM Last Post: dgm |
|
iterating over N lists in parallel | Skaperen | 6 | 5,282 |
Mar-24-2017, 06:51 AM Last Post: buran |
Users browsing this thread: 1 Guest(s)