def get_my_age():
return 21
The students' reaction to this in office hours can be... interesting. I am curious how many of them actually follow the comment at the bottom of the question, and what they think:> Reflect on the difference between creating a variable with a constant value and creating a function with no arguments and a constant return value.
Up to you to decide if this has any pedagogical value. The real learning objective was to "write a function that has no arguments but returns a constant value", so getting them to draw big conclusions about the nature of functions and values and so on is outside the scope of this little activity.