Beginer Building AI questions
I am really new to python so my code is as dirty as hell.
I tried the advanced exercise 1 (after success for intermediate mode) so here are my questions:
I thought there was a library to do the job? → is itertools allowed?
With itertools.permutations and a crappy display of my own, I finaly got the 24 routes starting in "PAN" and the result seemed quite similar to what was requested (identical?)
test : Too few route combinations ....
fact 1: I didn't write any recursive function.
fact 2: I work with the objects of the list, not the indexes
fact 3: I haven't implemented the function permutations(route,ports) yet
indeed I almost didn't use any of the given template.
So should I:
- by any "trick" use your display which is based on indexes
- go on and it will be ok when I have implemented permutation(route,ports) even if it is not recursive
- forget itertools for now and write my own recursive permutations(ports) which I tried but failed as far as combining even the letters of the port names, probably due to lack of python knowledge.
all this to avoid doingthings the wrong way now and later in the lessons.
thx ;)
Edit : finaly got the exercice ok importing itertools and using indexes to keep your exact printing. only answer no to my questions was : Should i write my own recursive function?no