def modern_print(string, messages=set()): if string not in messages: print(string) messages.add(string)