How do i fix a bug where Hello world! is printed twice? The output: {clear}Hello World! {clear}{clear}Hello World! The terminal is cleared [Finished in 3.4s] The code: Answer clear does not clear the global list messages; it creates a new local variable that is assigned an empty list before going away when clear returns. Either use global or use the