The text in problem 4, PS4, goes like "Your function should print out the current estimate for the amount of expenses on each iteration through the binary search". The thing is that the ps4.py template is savning the function call to a variable and prints out this variable after that. I'm appending each guess through the iteration and the final guess too to a list and I return this list in my function.The problem with this solution is that the answer is in one big chunk - any suggestions ???
Here is my solution.
I'm sure exactly what the problem is here, but to hazard an answer, if you want to print the last item after you've appended to the expenseGuesses list you can use something like, print expenseGuesses[-1] you can then use the same on the list the function return to get your final guess. Does that answer your question?
ps, I meant NOT sure exactly what the problem is :)
Join our real-time social learning platform and learn together with your friends!