+ 3

Problem

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

19th Jan 2025, 6:35 PM
stefan lucchesi
stefan lucchesi - avatar
8 Respuestas
+ 7
stefan lucchesi , you have already posted the same topic ***5 times***. this doesn't help for speeding up the process of solving the issue. > as Ausgrindtube already mentioned, it's up to you now to present a serious code attempt first.
19th Jan 2025, 7:42 PM
Lothar
Lothar - avatar
+ 5
Irbis [-TEC-] , the code sample that you have presented does not create the expexted output. > output should be done in 2 lines like: Group 1: ['Alice', 'Bob'] ...
20th Jan 2025, 3:47 PM
Lothar
Lothar - avatar
+ 4
Hi stefan lucchesi , we know the task, what we need to see is how you've tried to solve it. How do you split/slice a list? Can you add your code like this guide? https://sololearn.com/compiler-playground/Wek0V1MyIR2r/?ref=app https://sololearn.com/compiler-playground/W3uiji9X28C1/?ref=app
19th Jan 2025, 6:40 PM
Ausgrindtube
Ausgrindtube - avatar
20th Jan 2025, 3:34 AM
BroFar
BroFar - avatar
+ 2
Here's the thingy: https://sololearn.com/compiler-playground/c4CjsFPcIuFK/?ref=app also don't spam the same question over and over, cause you gonna get everyone mad, idk why.
20th Jan 2025, 7:57 AM
#1 REIGN ADDICT
#1 REIGN ADDICT - avatar
+ 1
Lothar Ik, was just a bit lazy to do that
20th Jan 2025, 4:01 PM
#1 REIGN ADDICT
#1 REIGN ADDICT - avatar
0
just do this g1= players[1:2] g2=players[2:4] g3=players[4:6] And print print("Group 1 : " + g1) print("Group 2 : " + g2) print("Group 3 : " + g3) Use the players list for this
21st Jan 2025, 2:30 PM
ROHAN PATIL
ROHAN PATIL - avatar