Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kav_cha3 #280

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions github/funfacts/Spring2022/Kavitha/funfact.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Kavitha
Not a workout freak but now going for boxing classes
30 changes: 19 additions & 11 deletions python/secret_recipe_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,28 @@ def __init__(self, amount, description) -> None:


def decode_string(str):
"""Given a string named str, use the Caesar encoding above to return the decoded string."""
# TODO: implement me
return '1 cup'
Return_String = ""

for Tmp_char in str:
if Tmp_char in ENCODING:
Return_String = Return_String + ENCODING.values()

return Return_String



def decode_ingredient(line):
"""Given an ingredient, decode the amount and description, and return a new Ingredient"""
# TODO: implement me
return Ingredient("1 cup", "butter")

decoded_line=()
split_line=line.split('#')
for word in split_line:
decoded_line = decoded_line + ( decode_string(word),)

def main():
"""A program that decodes a secret recipe"""
# TODO: implement me
return decoded_line

if __name__ == "__main__":
main()


def main():
with open('secret_recipe.txt', 'r') as Encoded_Recipe:
for line in Encoded_Recipe:
decode_ingredient (line)