I am having some trouble getting the the final two functions in EX25 two work as shown in the book. I can complete all of the steps before in python running in the shell, but the last two functions don’t return anything. I was able get it them to return properly by adding a return line to each of them, but I would really like to understand what mistake I am making when trying to use the solution in the book. Thanks!!
having issues with print_first_and_last(sentence) and print_first_and_last_sorted(sentence)
The last two are not working as shown in the book because they are not shown as in the book.
I changed mine to #print_first_word(words) and added return print_first_word(words), print_last_word(words) and it did the same, which is nothing.
calling the function and not returning it works here for me.
Try retyping exactly as in the book, even if it means starting over. That’s something Mr. Shaw recommends sometimes. It may work, if not then repost with [code] and someone with more knowhow can help break it down for you (us).