Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
21 changes: 19 additions & 2 deletions bigrandom/answer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ def answer(self):
# ommiting line number and its hashtag

# your algorithm

data = open(brd.data, "r")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ini benerin lagi, manggil datanya ga boleh kayak gini

for line in data:
i = 0
while(line[0] != "#"):
line = line[1:]
i += 1
line = line [1:]
for y in line:
if(y == "#"):
noh += 1
suc += ord(y)
data.close()
return (noh,suc)

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

brd = BigRandom()
noh, suc = brd.answer()

print("Sum of Hastag :", noh)
print("Sum of ASCII :", suc)
12 changes: 11 additions & 1 deletion caesar/answer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ def answer(self):
key = 0 # variable to store the key

# your algorithm
data = open(chiper.data, "r")
Ascii = range(128)


data.close()
return (key)

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


chiper = Caesar()
ans = chiper.answer()

print ("Key to encrypt and decrypt chypertext: ", ans)