Skip to content

Commit 68ba534

Browse files
committed
section5 final
1 parent 0300841 commit 68ba534

File tree

24 files changed

+180
-0
lines changed

24 files changed

+180
-0
lines changed

Section5/.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section5/.idea/Section5.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section5/.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section5/.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section5/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section5/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section5/lecture51/Program1.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Program to show list comprehension in Python
2+
3+
list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9]
4+
list2 = [n**2 for n in list1]
5+
print("list2 = ", list2)

Section5/lecture51/Program2.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# program to filter a list and create new list
2+
3+
list1 = ["David", "Sam",
4+
"Adam", "Don", "Fred", "Dante", "Paul"]
5+
filtered_list = [s for s in list1 if s.startswith("D")]
6+
print("Filtered list : ", filtered_list)

Section5/lecture51/__init__.py

Whitespace-only changes.

Section5/lecture52/Program1.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Program to show dictionary comprehension
2+
3+
keys = ["David", "Paul", "Jose", "Adam"]
4+
values = [32, 31, 39, 35]
5+
user_dict = {x:y for (x,y) in zip(keys, values)}
6+
print("user_dict = ", user_dict)
7+

0 commit comments

Comments
 (0)