Jan-09-2019, 03:04 PM
What you are seeing is the default text representation (repr) of the object you have created. That may be the correct answer, but it's not showing you the information to determine that. You need to override the __repr__ method of cvor so that it gives you better info. Your cvor (I'm not sure if this is the actor or the film) class is very bare bones, I would expand it:
BTW, it's breadth-first search, with a d. Breath is taking in air through your mouth and nose, breadth is how wide something is.
class cvor(object): def __init__(self, ime): self.ime = ime self.susjed = [] def __repr__(self): return '<cvor {} ({})>'.format(self.ime, len(self.susjed))Now you don't need kreiranjeCvora. You can just do
cvorFilm = cvor(imeFilma)
. Also, the output you get should be more intelligible.BTW, it's breadth-first search, with a d. Breath is taking in air through your mouth and nose, breadth is how wide something is.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures