File tree Expand file tree Collapse file tree 7 files changed +17
-2
lines changed Expand file tree Collapse file tree 7 files changed +17
-2
lines changed Original file line number Diff line number Diff line change
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 )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ def f_to_c(temp):
3
3
4
4
return f"{ temp } degrees Farenheit is { round (Cel )} degrees Celsius."
5
5
6
+
6
7
def c_to_f (temp ):
7
8
FarenH = (temp * 1.8 ) + 32
8
9
Original file line number Diff line number Diff line change 1
1
def vowel_counter (sentence ):
2
2
counter = 0
3
3
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" :
5
5
counter += 1
6
6
7
7
return f"Number of vowels: { counter } "
Original file line number Diff line number Diff line change 1
1
from ex1 import hello_world
2
2
from ex10 import calculator
3
3
from ex11 import diagonal_printer
4
+ from ex12 import word_histogram
4
5
from ex2 import array_to_string
5
6
6
7
# ex1
67
68
68
69
# ex11
69
70
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" )
You can’t perform that action at this time.
0 commit comments