On Sat, Oct 1, 2016 at 2:02 AM, Alan Gauld via Tutor <tutor@python.org> wrote:
> Do you need print_msgs()? > Won't it work the same with > > print(right_justify(input_string)) > > You are only feeding one line at a time into the print msgs. > > You could do it all in a new print_msgs() like: > > def print_msgs(formatter, msgs): > for msg in msgs: > print(formatter(msg)) > > And main() reduces to > > def main(): > print_msgs(right_justify, input_strings) I have to say this thought you gave ties in nicely with the other thread ([Tutor] Passing functions as arguments to other functions) I started in parallel with this one. A practical example of passing a function to another function... -- boB _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor