Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create_data_structure(example_input):
- network = {}
- if example_input == "":
- return []
- p = example_input.split(".")
- #print p
- i = 0
- j = 1
- for p[i] in p:
- if p[i] != p[j]:
- #print p[i]
- t = p[i].split("is connected to")
- #print t
- if p[j] == p[i]:
- s = p[j].split("likes to play")
- #print s
- for e in t:
- network = "e[0]"
- {
- "friends":["Bryant", "Debra", "Walter"],
- "games":["The Movie the Game","The Legend of Corgi", "Dinosaur Diner"]
- print network
- i = i + 2
- j = j + 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement