Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yozaam committed Oct 19, 2020
1 parent f34978b commit 3fbc7f8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
18 changes: 18 additions & 0 deletions day1_char_count.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
countOfChar = {
#store the count of all chars
#as a pair
#eg. 'a' : 5
# 'b' : 6
}

string = "hello rashil"

for char in string:
if char in countOfChar:
countOfChar[char]+=1
#he has already been found just increment him
else:
countOfChar[char] = 1
#he was not found so i initilized him

print(countOfChar)
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
countOfChar = {


#store the count of all chars
#as a pair
#eg. 'a' : 5
# 'b' : 6
}

string = "hello rashil"
Expand Down

0 comments on commit 3fbc7f8

Please sign in to comment.