How to ask a good question

To increase your chance of getting a high-quality answer, you want to focus on asking a high-quality question. Before we dive into the tips, let’s think of a hypothetical situation so that we can create an example question.

Hypothetical Situation

When you ran the following code:

print(sum([1, 2, 3]))

you received the following error:

TypeErrorTraceback (most recent call last)
<ipython-input-1-96fd51102535> in <module>()
----> 1 print(sum([1, 2, 3]))

TypeError: 'int' object is not callable

What should you do?

1. Search first

The magnifying glass in the upper-right corner is the perfect place to start. If you find things that are related to your question but don’t fully answer it, it will be helpful to link to those questions to give as much context as possible to other Community members.

If you’re unable to find a solution from the search results, then it’s time to create a post.

Pro Tip: Google-Fu is an incredible skill to learn for a future data scientist like you.

2. Write a unique title

What details need to be included for you to sum up your issue in one sentence?

Example: TypeError: 'int' object is not callable - Can't identify the redefined function name

3. Always introduce your problem first, then give us examples of code

Example:

I am getting TypeError: 'int' object is not callable. Based on this article, we can fix it by running del followed by the function name. However, when I attempted to do it with my code, I’m getting the same error. I don’t know how to fix it.

Here is the code that I have used:

print(sum([1, 2, 3]))

And here is my attempt at doing what is mentioned in this article:

del print
print(sum([1, 2, 3]))

4. Include the link to the lesson

This is incredibly important and helps bring context to the issue or question.

5. Use Markdown to style your question

Markdown is a very handy syntax to learn. It’s catching up a lot of traction and more and more forums are implementing this. Therefore, it would help you not only in our Community but also with other forums on the internet. If you’re unfamiliar with Markdown, I would recommend you this cool interactive markdown tutorial. Or if you just need a refresher, check out this post.

6. Avoid posting screenshots of your code or errors

Instead, put the corresponding piece of code enclosed in backticks:

  • Use single backticks for an inline piece of code, e.g.: `my code`
  • Use triple backticks for a multi-line piece of code, e.g.:
    ```
    my
    multi-line
    piece of code
    ```

Screen Recording 2020-06-10 at 07.12 PM

Note: Pay attention that those are not single quotes ''', they are backticks ```. You can find it just below the Esc key in most English keyboard layouts.

7. Keep tabs on your question!

Don’t run as soon as you’ve posted, in case there’re clarifications needed.


Stack Overflow has a great, comprehensive article on asking a good question.


To conclude, this is how our hypothetical question will look like:

As always, abide by our Community Guidelines.

Further reading

16 Likes