Since it's a relatively ambiguous question that you have to solve, the appropriate thing to do is comment your code with your assumptions. In general, commenting ambiguity, or anywhere where you have questions, is best practice.
Here, the ambiguity is the range of numbers. Is it [1,20], i.e. inclusive? (Probably.) But it could also be (1,20) (exclusive), or a mix, e.g. [1,20). In fact, many loop or range functionalities expect an input of the form [x,y)!
Ambiguity? Comment the shit out of it, if you'll pardon my segue to french.SE!
If you get the code and your assumptions right, then you have clean, clear code and you'll be making best practice into routine. Programmers will love you forever if you comment your code. We almost don't care about it working, by comparison, as long as there's some English there so we can follow your lead.
If your answer isn't what is expected, many courses will hand the code off to grad students to look at. If your comments detail your work so that they can understand it, and your code did what you thought it did, you often get at least some credit. This means that if your code is right but your assumptions are wrong, you're only faulted on your assumptions, and you get credit for writing code that does what you want.
...will add the integers [1,20]
, which unambiguously states that the range is inclusive of 1 and 20.