0

Python " relay race" test in beginner course isn't working for me.

https://sololearn.com/compiler-playground/cFzwc7Md10cU/?ref=app

8th Nov 2024, 11:12 AM
Abdur Rahman
Abdur Rahman - avatar
8 odpowiedzi
+ 3
you can change the value of sep to an empty string, e.g.: print("Group 1:\n",g1, sep="") Or you print g1 in an extra print() on the next line.
8th Nov 2024, 12:44 PM
Lisa
Lisa - avatar
+ 5
print() has a separate sep=" ". Look at the expected output: There is no blank space in front of the name lists
8th Nov 2024, 12:10 PM
Lisa
Lisa - avatar
+ 3
or use f-string, so you won't invoke the sep. print(f"Group 1:\n{g1}")
9th Nov 2024, 2:19 AM
Bob_Li
Bob_Li - avatar
+ 2
Hi Abdur Rahman , If you’re trying to create three lists using slicing, your code appears to achieve that. What specific issue are you experiencing?
8th Nov 2024, 12:04 PM
Per Bratthammar
Per Bratthammar - avatar
+ 2
They simply want separate groups of two and separate print lines of the groups ... Create the slices as g1 = players[0:2], g2= , g3= Then below each print(Groups) they want a separate print of groups as g1, g2, g3 print("Group 1:") #display the 1st group print(g1)
9th Nov 2024, 6:36 AM
BroFar
BroFar - avatar
+ 2
# Hi Abdur Rahman, # Here’s an example based on your code idea, # with a few adjustments to make it more efficient: # https://sololearn.com/compiler-playground/c08M8RnDTW06/?ref=app
10th Nov 2024, 6:15 PM
Per Bratthammar
Per Bratthammar - avatar
+ 1
Tnx Lisa so how do I solve it?
8th Nov 2024, 12:26 PM
Abdur Rahman
Abdur Rahman - avatar
+ 1
Lisa how to be a mentor
8th Nov 2024, 12:39 PM
Md Hachan Noor
Md Hachan Noor - avatar