0

Is anyone able to help me understand bellow exercises ? i need to implement Graph Class. The example of usage

g = Graf(set([1,2,3]), set([(1,2), (2,3), (3,1)]))
for podgraf in g:
    print podgraf

and the answer should be

enter image description here

I'm looking on this exercise over 2 hours and i do not know how even start it. I am aware of iter and next but i really do not know how to start or where i could find usefull information. I would be verry appreciated for Hint or explanation how could look on this problem.

JxCode
  • 160
  • 5
Bard91
  • 11
  • 1
  • 4
  • 2
    Please read a similar question here - https://stackoverflow.com/questions/19472530/representing-graphs-data-structure-in-python – Anatolii Dec 19 '19 at 21:00
  • First you need to clarify what you are trying to solve. What exactly are you doing with the Graph? What do the parameters to `Graf()` represent? What is each `podgraf`? What does the output mean? – Code-Apprentice Dec 19 '19 at 21:32
  • Also, I suggest that you learn Python 3, not Python 2, because Python 2 will no longer be supported in two weeks. – Code-Apprentice Dec 19 '19 at 21:36

0 Answers0