Skip to content

Commit 15f5482

Browse files
committed
section8 final
1 parent 7763541 commit 15f5482

33 files changed

+245
-0
lines changed

Section8/.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.

Section8/.idea/Section8.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.

Section8/.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.

Section8/.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.

Section8/.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.

Section8/.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.

Section8/lecture81/Program1.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Program to show counters in Python
2+
3+
list1 = ["a", "b", "c", "d", "e", "f"]
4+
from collections import Counter
5+
print("Count of list1 = ", Counter(list1))
6+
7+
list2 = [1, 2, 3, 4, 1, 2, 1, 3, 1]
8+
print(" Count of list2 = ",Counter(list2))
9+
10+

Section8/lecture81/Program2.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Program to show Arithmetic operations on Counter
2+
3+
from collections import Counter
4+
c1 = Counter({"a": 2, "b": 3, "c": 5})
5+
c2 = Counter({"a": 4, "b": 3, "c": 1})
6+
print("c1 + c2 = ", (c1 + c2))
7+
print("c2 - c1 = ", (c2 and c1))
8+
print("c2 - c1 = ", (c2 - c1))
9+
print("c2 and c1 = ", c1 and c2)
10+
print("c2 or c1 = ", c1 or c2)
11+
12+
13+
14+

Section8/lecture81/Program3.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Program to show counter with strings
2+
3+
str1 = "i like Apple"
4+
5+
from collections import Counter
6+
print(Counter(str1))
7+

Section8/lecture81/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)