Selecciona la opción correcta del menú desplegable para completar el texto.
Imagine a game on a map. At the beginning, we might want to randomly assign each player a starting point. Which of the following expressions may we use in place of the question marks to correctly implement this functionality?
import random
def random_point():
"""Returns a random point on a 100x100 grid."""
return (random.randrange(100), random.randrange(100))
def starting_points(players):
"""Returns a list of random points, one for each player."""
points = []
for player in players:
point = random_point()
( points + point, points.extend(point), point.append(points), points.append(point), points += point )
return points