Typeerror lab 4

I imagine this is similar to: Still get string format problem on tesing "split_dataset_test" , though I’m finding that it has little to do with brackets.

I had my code print out exactly what your testing system is getting. Right before the error (TypeError: unsupported format string passed to list.format), my code is passing your tester two left and right node lists:
[1, 3, 6]
[9, 2, 10, 7]

The above is exactly as printed out by my function.

I rewrote the code so it would use a for loop rather than array and set functions. This eliminates the error and my function prints the following two outputs:
[1, 3, 6]
[2, 7, 9, 10]

The only difference I see between my original code and the for loop version is the order of the indices, which I don’t imagine should make much difference in any actual application.

Anyway, the error wasted a lot of my time because I couldn’t understand what was wrong–still don’t. I’ve passed the lab, but just thought you should know that this issue exists. Perhaps just warning people that the output must be sorted from lowest to highest would avoid some of the issues I had.


Hello Peter @Peter_Muhlberger,

I have sent a direct message to you about this.