Skip to content

Commit 1e6cf80

Browse files
committed
12/13
1 parent dcadf10 commit 1e6cf80

File tree

7 files changed

+17
-2
lines changed

7 files changed

+17
-2
lines changed

Diff for: __pycache__/ex12.cpython-310.pyc

367 Bytes
Binary file not shown.

Diff for: __pycache__/ex8.cpython-310.pyc

0 Bytes
Binary file not shown.

Diff for: __pycache__/ex9.cpython-310.pyc

0 Bytes
Binary file not shown.

Diff for: ex12.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def word_histogram(words):
2+
dictionary = {}
3+
for word in words.split():
4+
if word in dictionary.keys():
5+
dictionary[word] = dictionary[word] + 1
6+
else:
7+
dictionary[word] = 1
8+
9+
print(dictionary)

Diff for: ex8.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ def f_to_c(temp):
33

44
return f"{temp} degrees Farenheit is {round(Cel)} degrees Celsius."
55

6+
67
def c_to_f(temp):
78
FarenH = (temp * 1.8) + 32
89

Diff for: ex9.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
def vowel_counter(sentence):
22
counter = 0
33
for i in sentence:
4-
if(i == "a" or i == "e" or i == "i" or i == "o" or i == "u"):
4+
if i == "a" or i == "e" or i == "i" or i == "o" or i == "u":
55
counter += 1
66

77
return f"Number of vowels: {counter}"

Diff for: main.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from ex1 import hello_world
22
from ex10 import calculator
33
from ex11 import diagonal_printer
4+
from ex12 import word_histogram
45
from ex2 import array_to_string
56

67
# ex1
@@ -67,4 +68,8 @@
6768

6869
# ex11
6970

70-
diagonal_printer("This is a test")
71+
# diagonal_printer("This is a test")
72+
73+
# ex12
74+
75+
word_histogram("three three three two two one")

0 commit comments

Comments
 (0)