If you're stuck, give as much detail as possible about what you tried and what you're seeing. Include the code you’ve written and the exact error messages that you see, and any other actions that you've tried.
Don't just post the code.
Posts that consist only of code with no other information are not appropriate. Describe what you tried, what did and didn't work, what you understand or have questions about, and what you think might be going on.
Format your code for clarity.
Use Markdown to format your code, mark things italics or bold, and do other formatting that will help your clarity.