Write a function that will create and return a Python list
of the numbers up to n (inclusive).
That is, numberList(6)
should return the list [1, 2, 3, 4, 5, 6]
and numberList(0)
should return the empty list []
.
You can create an empty list like so:
nums = []
...and you can add a number to the end of an existing list using append()
like this:
# assume that FOO contains [2, 4]
FOO.append(6)
# now FOO contains [2, 4, 6]
©2017 Graham Mitchell