Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions bigrandom/answer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,21 @@ def answer(self):
# ommiting line number's hashtag
suc = 0 # variable to store sum of character's code in ascii,
# ommiting line number and its hashtag

data = open(self.data, 'r')
l = data.readline()
# your algorithm
for line in data:
for ch in line:
suc += ord(ch)
if ch == '#':
noh += 1
noh -= 1

data.close()
return (noh,suc)

# add methods if you need more
ans = BigRandom()
noh, suc = ans.answer()

print('NOH: ' + str(noh))
print('SUC: ' + str(suc))
2 changes: 1 addition & 1 deletion caesar/answer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def answer(self):

return (key)

# add methods if you need more
# add methods if you need more