I use dijkstra algorithm and make shortest_subway_route python code.
It's main
if __name__ == '__main__':
graph = Graph() #class define add_node,add_egde
subway() #def use add_node,add_egde
sub = transkor() #def read .txt and make Dictionary
s=int(input("start>>")) #input subway_number
d=int(input("end>>")) #input subway_number
R=shortest_path(graph, s, d) #def view how to use subway route
sub_num =R['return1']
subkor = list()
num = 0
for s in sub_num :
kor = sub[s]
subkor[num] = kor
num+=1
print(sub_kor)
print("time =",R['return0'])
R['return1'] is list of subwaynumbers
I tried to save the subway number in Korean. But "subkor[num] = kor" is list assignment index out of range error.
What can I do?
I also use "subkor.append(num) = kor" but can't assign to function call error