In the function print_last_word Zed used
print_last_word
word = words.pop(-1)
to pop off the last word.
I looked up the definition for pop() and it says that -1 is the default. So using
word = words.pop()
should give the same result.
Is it considered “good manners” to use the -1 here?
You are correct. Pop() default (last in list) is the most typical use case so this is a short cut.
True believers might wave the Python style guide and proclaim that ‘explicit is better than implicit’, but I think in this case you’re fine. Everybody writes pop just like that.
Thank you guys for your answers.