The
Docs for ranges: https://docs.python.org/3/library/stdtyp...sseq-range.
stop
parameter is excluded (that is, the final value in range(1, num)
will be num - 1
). So if you want a range from 1 up to and including num
, you need to pass num + 1
for stop
.Docs for ranges: https://docs.python.org/3/library/stdtyp...sseq-range.