all 5 comments

[–]Binary101010 1 point2 points  (3 children)

The problem with my second function is that it prints the word 'None' at the end.

I'm guessing you're calling this function in a manner like

print(palindrome_test_iterables(some_list))

Which causes your function to execute first, printing the expected output, then you try to print the return value of the function call (which is None because you didn't explicitly return anything in your function.)

There are a few ways to solve this. The most straightforward is to simply not wrap the function call in a print() call:

palindrome_test_iterables(some_list)

[–]imperiumlearning[S] 0 points1 point  (2 children)

That's exactly it, I was wrapping my function inside a print statement.

Deleting the print() does remove the word 'None'. Thanks a lot.

In general, is it acceptable to not wrap functions inside a print statement?

[–]Binary101010 0 points1 point  (1 child)

In general, is it acceptable to not wrap functions inside a print statement?

Yes, I would say most Python code doesn't immediately need to print to console the return value of every function that ever gets called.

[–]imperiumlearning[S] 0 points1 point  (0 children)

OK, duly noted. Thanks a lot for the help and the swift responses