(Mar-03-2018, 06:57 PM)Larz60+ Wrote: I don't understand why the order and years lists are there,i actually want this to print in an order, it starts from Jack Jack and then 2nd set starts from Jeni Jeni, that is why i have used the order list
Names=["Jack","Jeni","Monsa","Mehus","Kuis","Tim","Tony","Yestgf","Pere"] # Years=[17,20,26,40,67,88,96,99,37] # Order=[1,2,3,4,5,6,7,8,9] # for names,years,orders in zip(Names,Years,Order): # for i in range(1,(len(Order)+1)): # for j in range(i,i+len(Order)): # jdisplay = Names[j % len(Order)] if (j % len(Order)) else Names[j] # print(names,Names[j]) for name in Names: for name1 in Names: print('{} {}'.format(name, name1))
Accessing data in zip - Index out of range
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
How to fix list index out of range | longmen | 26 | 6,067 |
Apr-27-2022, 05:46 PM Last Post: deanhystad |
|
list index out of range | OliverG | 3 | 2,353 |
Sep-03-2021, 12:04 AM Last Post: itsmycode |
|
List index out of range when turning CSV into dict | ranbarr | 15 | 6,493 |
May-12-2021, 10:38 AM Last Post: ranbarr |
|
list index out of range | mcgrim | 2 | 2,922 |
May-25-2019, 07:44 PM Last Post: mcgrim |
|
IndexError: list index out of range | abdullahali | 4 | 3,879 |
Jan-17-2019, 07:54 AM Last Post: buran |
|
String index out of range | felie04 | 2 | 5,550 |
Aug-17-2018, 11:18 PM Last Post: felie04 |
|
"List index out of range" for output values | pegn305 | 3 | 5,319 |
Nov-26-2017, 02:20 PM Last Post: heiner55 |
|
list index out of range | DrPengin | 1 | 3,702 |
Nov-09-2017, 08:35 PM Last Post: gruntfutuk |
|
string index out of range | cusick11 | 9 | 15,153 |
Mar-03-2017, 11:45 PM Last Post: ichabod801 |
|
Invalid syntax: string index out of range | darkreaper1959 | 6 | 6,184 |
Jan-22-2017, 06:24 PM Last Post: nilamo |
Users browsing this thread: 2 Guest(s)