Consider a class with a procedural method, that is, a method that does
something:
class Duck:
def swim(self):
"""Flap feet in a rhythmic manner so as to gracefully move
through water.
"""
Here, we naturally write as if giving instructions to the duck, that is,
using the imperative mood. "Duck, swim."
From there, it isn't a big step to using the same mood for functions:
def count(haystack, needle):
"""Return the number of needles in haystack."""
Here we are figuratively instructing the function, telling it what to do:
"Function, return the number of needles found in this haystack."
--
Steven