May-11-2017, 02:40 PM
Actually, it's a little longer homework...,First, I had to get the data from the file, I got it done......
CODE:
CODE:
def Children_and_parents(f1, f2): f = open(f2, encoding = "UTF-8") ff = open(f1, encoding = "UTF-8") m = {} s = [] new_dic = "?????" for i in f: d = i.split() for osa in d: m[" ".join(d[1:])]= d[0] for ri in ff: os = ri.split() s.append(os) return(new_dic)But now I'm stuck, How i find parents and their children,and put them in a new dictionary(new_dic)