Python Forum
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Names and codes
#3
Actually, it's a little longer homework...,First, I had to get the data from the file, I got it done......
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)
Reply


Messages In This Thread
Names and codes - by janek30 - May-11-2017, 12:27 PM
RE: Names and codes - by Larz60+ - May-11-2017, 12:36 PM
RE: Names and codes - by janek30 - May-11-2017, 02:40 PM
RE: Names and codes - by nilamo - May-11-2017, 03:59 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020