Please or Cadastrar to create posts and topics.

Issue with Code Compilation in Python


I am currently encountering a problem while compiling my Python code and I am seeking guidance on how to resolve it. I have been receiving a SyntaxError: invalid syntax message, yet I am unable to identify the mistake in my code. Here is a portion of the code I am working with:

def my_function()
print("Hello, World!")

It is evident that this function is quite elementary, however, it is unable to compile. I believe there may be a minor error that I am missing.

I have attempted to troubleshoot the issue by utilizing the Python Online Compiler to execute my code, however, the error continues to persist. I am curious if anyone else has come across a similar problem or if you could offer any insights into the potential cause of this syntax error.

Your assistance in this matter would be greatly appreciated.