+ 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
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.
+ 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']
...
+ 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
+ 4
Muhammad Rizal please do not spam in threads ...
https://www.sololearn.com/discuss/1316935/?ref=app
https://www.sololearn.com/discuss/3021159/?ref=app
+ 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.
+ 1
Lothar
Ik, was just a bit lazy to do that
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