""" birthday_3.py Third version of HBS (Happy Birthday Song). Print only in main; less repitition. Try this with pythontutor.com to see exactly what's going on. """ def to_you_line(h, comma): """ Return one line of the birthday song """ # Includes the newline character at the end of the line. return f"{h}appy birthday to you{comma}\n" def dear_line(name): """ Return first line with 'dear' of HBS """ return f"happy birthday dear {name},\n" def song(name): """ Return the entire HBS song as one string. """ return to_you_line('H', ',') + \ to_you_line('h', ',') + \ dear_line(name) + \ to_you_line('h', '!') def main(): """ Print the HBS. """ print(song('Sally')) main()