Corrected Silly Errors
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
# @Last Modified by: Cutieguwu | Olivia Brooks
|
# @Last Modified by: Cutieguwu | Olivia Brooks
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
||||||
def decrypt(dataEncoded: str, key: str):
|
def decrypt(dataEncoded: str, keyDecrypt: str):
|
||||||
"""
|
"""
|
||||||
Decrypts a string encoded using a substitution cypher based on the provided key.\n
|
Decrypts a string encoded using a substitution cypher based on the provided key.\n
|
||||||
Characters closer to index 0 in `key` are more common in the English language.
|
Characters closer to index 0 in `key` are more common in the English language.
|
||||||
@@ -23,9 +23,7 @@ def decrypt(dataEncoded: str, key: str):
|
|||||||
|
|
||||||
dataDecrypted = ""
|
dataDecrypted = ""
|
||||||
|
|
||||||
# Convert key to a list.
|
keyEnglish = "etaoinshrdlcumwfgypbvkjxqz" # Lewand's order of english characters; most to least common.
|
||||||
keyDecrypt = [].append(k for k in key)
|
|
||||||
keyEnglish = [].append(k for k in "etaoinshrdlcumwfgypbvkjxqz") # Lewand's order of english characters; most to least common.
|
|
||||||
|
|
||||||
for c in dataEncoded:
|
for c in dataEncoded:
|
||||||
is_found = False
|
is_found = False
|
||||||
@@ -38,3 +36,5 @@ def decrypt(dataEncoded: str, key: str):
|
|||||||
|
|
||||||
return dataDecrypted
|
return dataDecrypted
|
||||||
|
|
||||||
|
|
||||||
|
print(decrypt("asdafhedjwandseifhbjnwj", "qwertyuiopasdfghjklzxcvbnm"))
|
||||||
Reference in New Issue
Block a user