Skip to content

Commit 56bb5e1

Browse files
committed
After Course section5
1 parent b443c0c commit 56bb5e1

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

Section5/.idea/Section5.iml

Lines changed: 4 additions & 2 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: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section5/lecture51/Program3.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Program to show set comprehension
2+
3+
set1 = {1, 2, 3, 4, 5}
4+
set2 = { n**2 for n in set1}
5+
print("set2 = ",set2)

Section5/lecture52/Program2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Program to convert a list to a dictionary
22

33
list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9]
4-
square_dict = {n:n**2 for n in list1}
4+
square_dict = {n: n**2 for n in list1}
55
print("square dict = ", square_dict)

Section5/lecture53/Program2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def add(types="int", *args):
66
for n in args:
77
add += n
88
return add
9-
elif types =="float":
9+
elif types == "float":
1010
add = 0.0
1111
for n in args:
1212
add += n

0 commit comments

Comments
 (0)