Skip to content

Commit 6fbd489

Browse files
committed
addtional learn ListComprehensions in python
1 parent 1a0f9b0 commit 6fbd489

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/hakerrank/datatype/ListComprehensions.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
#list1 = [x for x in range(101) if x % 2 == 0]
1010
#print(list1)
1111

12-
// == [1, 2, 3, 4, 5]
12+
#list =[]
13+
#for x in range(101):
14+
# if x % 3 == 0:
15+
# list.append(x)
16+
17+
#print(list)
1318

14-
intList = []
15-
print(intList)
19+
List2 = [x for x in range(101) if x % 3 == 0]
20+
print(List2)

0 commit comments

Comments
 (0)