Skip to content

Commit 95af0a0

Browse files
author
Calvin Gutierrez
committed
undersanding list
1 parent 01a78ca commit 95af0a0

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

days/04-06-collections/playground.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@
1212
# defaultdict
1313
# Counter
1414
# deque
15+
16+
words = """Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
17+
the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and
18+
scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into
19+
electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of
20+
Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus
21+
PageMaker including versions of Lorem Ipsum""".split()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Exercise 1: Reverse a list in Python output ; [500, 400, 300, 200, 100]
2+
list1 = [100, 200, 300, 400, 500]
3+
print(list1[::-1])
4+
5+
# Exercise 2: Concatenate two lists index-wise output ; ['My', 'name', 'is', 'Kelly']
6+
list2 = ["M", "na", "i", "Ke"]
7+
list3 = ["y", "me", "s", "lly"]
8+
9+
list4 = []
10+
for i, j in zip(list2, list3):
11+
list4.append(i + j)
12+
print(list4)

0 commit comments

Comments
 (0)