Questions tagged as 'tuple'

1
answer

Indexes of tuples in a list - python

Organizing information in the file (City, City, Distance) import csv with open('cidades.csv', 'r') as f: list1 = [tuple(line.values()) for line in csv.DictReader(f)] for i in list1: x=(list1[i]) print(distancia=x[2]) To a...
asked by 10.11.2017 / 00:27
0
answers

Deep search - python

import csv with open('cidades.csv', 'r') as f: list2 = [tuple(line.values()) for line in csv.DictReader(f)] def dfs_helper(list2, start_city, end_city): pilha = [] visited = [] adj_cities = get_connections(list2, start_city)...
asked by 10.11.2017 / 03:04