Currently, if I want to iterate 1 through n , I would use the following method:
for _ in range(1, n+1): print(_)
Is there a cleaner way to do this without referencing n + 1 ?
It seems strange that if I want to iterate over a range starting from 1, which is not unusual, I have to specify a double increase:
- With
1 at the beginning of the range. - C
+ 1 at the end of the range.
source share