Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
32 changes: 19 additions & 13 deletions bigrandom/answer.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
class BigRandom:
def __init__(self):
self.data = "data.txt"
# add attributes if you need more
def answer():
noh = 0 # variable to store number of hashtag
# 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('data.txt', 'r')
l = data.readline()
# your algorithm
for line in data:
for ch in line:
suc += ord(ch)
if ch == '#':
noh += 1
noh -= 1

def answer(self):
noh = 0 # variable to store number of hashtag
# ommiting line number's hashtag
suc = 0 # variable to store sum of character's code in ascii,
# ommiting line number and its hashtag
data.close()
return (noh,suc)

# your algorithm
noh, suc = answer()

return (noh,suc)

# add methods if you need more
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