Python Forum
how can I initialize this code ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how can I initialize this code ?
#4
(Jan-22-2019, 01:54 PM)grandpapa10 Wrote: I indented the lines 4 spaces to the right.
I said dedent to the left, not indent to the right. It has to be all the way to the left.

(Jan-22-2019, 01:54 PM)grandpapa10 Wrote: I got an error since "shorpath" hasnt been given a value!
it has been given a value, but it takes 2 parameters start and end
Quote:
def shortpath(self, start, end):

Currently the code does not show anything so you need to print it to see the results.
def main():
    gg = Graph()
    path = gg.shortpath('C', 'I')
    print(path)

if __name__ == '__main__':
    main()
Output:
$ python3 test6.py ['I']
Recommended Tutorials:
Reply


Messages In This Thread
how can I initialize this code ? - by grandpapa10 - Jan-22-2019, 12:57 PM
RE: how can I initialize this code ? - by metulburr - Jan-22-2019, 01:45 PM
RE: how can I initialize this code ? - by metulburr - Jan-22-2019, 02:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  2 ways to initialize a list with all zero quazirfan 2 1,900 Aug-06-2021, 03:27 PM
Last Post: deanhystad
  Fatal Python error: init_sys_streams: can't initialize sys standard streams Attribute FatalPythonError 24 59,196 Aug-22-2018, 06:10 PM
Last Post: FatalPythonError

Forum Jump:

User Panel Messages

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