Skip to content

Commit 5a7cd04

Browse files
committed
range
1 parent a9b87f4 commit 5a7cd04

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

04. Lists/range.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# range is off_by_one.
2+
# it means it does not count the last value given to them
3+
# for e.g. range(1,5) prints from 1 to 4
4+
5+
for value in range(1,5):
6+
print(value)
7+
8+
make_list = list(range(1,6))
9+
10+
print(make_list)
11+
12+
for value in range(6): # range(6) start from 0
13+
print(value)
14+

0 commit comments

Comments
 (0)