PY-1.4-BP3-MQ30

Our Goal: Add a Comment to Your Code

In this lesson, you will learn how to add a comment to your code inside a Pull Request. This is like leaving a note for yourself or for others who might look at your code. You will go to the 'Files changed' part of your Pull Request and add a comment to one line of your code. You can ask a question or suggest a way to make it better.

Get Ready to Comment

Before you add a comment, make sure you are on the Pull Request page you just made on GitHub. You should see the code changes you made.

Go to the 'Files changed' tab on your Pull Request page. This is where you will add your comment.

Add Your Comment

Now, you will add a comment to your code. Follow these steps:

  1. Go to the 'Files changed' tab on your Pull Request page.
  2. Find a line of code you want to comment on. Move your mouse over the line number.
  3. A plus sign (+) should appear. Click on it!
  4. A box will open. Type your comment here. You can ask a question about the code or suggest a way to make it better.
  5. Click the button to add your comment.

Check Your Work Again

You've added your comment! Now, let's check to make sure it's there.

Go back to the 'Conversation' tab on your Pull Request page.

What you should see:

āœ… Your comment should appear in the conversation area. It should show which line of code you commented on.

If you see your comment, you did a great job!

Documentation

Documentation not available for PY-1.4-BP3.