Created
November 21, 2024 14:07
-
-
Save davidrajm/e978c9cfe857a82e97a8952675c10be6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def generate_city_transport_network(num_stations=10, num_routes=15): | |
stations = [f"Station_{i}" for i in range(num_stations)] | |
routes = [] | |
for _ in range(num_routes): | |
station1, station2 = random.sample(stations, 2) | |
routes.append((station1, station2)) | |
return stations, routes | |
if __name__ == "__main__": | |
stations, routes = generate_city_transport_network() | |
print("Stations:") | |
print(stations) | |
print("\nRoutes:") | |
print(routes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment