0

What’s wrong with my code?

players = ["Alice", "Bob", "Charlie", "David", "Eve", "Frank"] # Create 3 lists with 2 players each # Use slicing to create a list for Group 1 g1 = players[0:2] # Use slicing to create a list for Group 2 g2 = players[2:4] # Use slicing to create a list for Group 3 g3 = players[4:6] print("Group 1:", g1) # Display the 1st group print("Group 2:", g2) # Display the 2nd group print("Group 3:", g3) # Display the 3rd group

10th Nov 2023, 6:49 AM
lunaris
lunaris - avatar
1 Odpowiedź
+ 4
Your problem is very much the same as this post. Hope it helps. https://www.sololearn.com/discuss/3250788/?ref=app
10th Nov 2023, 7:17 AM
Wong Hei Ming
Wong Hei Ming - avatar