
Andrew McLane
3,385 PointsWhat is the ' '.join used for in the line print ("You can move {}".format(", ".join(get_moves(player))))
print ("You can move {}".format(", ".join(get_moves(player))))
I don't understand why or what we're joining.
1 Answer

Steven Parker
177,536 PointsThe "get_moves" function returns a list, and "join" converts a list into a string.
The string then becomes the argument to "format", which is the reason for performing the "join".
Andrew McLane
3,385 PointsAndrew McLane
3,385 Pointsthanks