Question: PYTHON PROBLEM: txt file to print ATTEMPTED: (it reads but im having trouble printing the lone 'k' from the file We will store this graph

PYTHON PROBLEM: txt file to print

PYTHON PROBLEM: txt file to print ATTEMPTED: (it reads but im having

trouble printing the lone 'k' from the file We will store this

graph in a dictionary: each person'sode's name will be a key (str)

ATTEMPTED: (it reads but im having trouble printing the lone 'k' from the file

whose associated value is a set of str of the peopleode names

of his her friends. Read a file where each line is either

We will store this graph in a dictionary: each person'sode's name will be a key (str) whose associated value is a set of str of the peopleode names of his her friends. Read a file where each line is either one node name (a person with no identifiable friends) or a pair of node names (representing an undirected friendship edge) in the graph. Note that node names may be any number of characters (not just the single characters used in this example), separated by one semicolon character. Build a dictionary whose keys are str node names, and whose associated values are sets of str node names that are friends. We annotate this dictionary as sstr:sstri). For example, the input file graphl.txt contains the following lines (which could appear in this order, or any other order, and still produce the same dictionary). By convention, we will put all friendless names at the end of the file. ajb ajc bjc cid dje dif Cjg 311 g3j ijj

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!