From 4fb8b9f903e664e920f1895703146ca61ddc521d Mon Sep 17 00:00:00 2001 From: Nick Rafferty <40009066+nickrafferty78@users.noreply.github.com> Date: Sun, 3 Sep 2023 15:33:47 -0600 Subject: [PATCH 1/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77cf77b4..9bd45c28 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ We have created starter projects in Java, Scala, and Python that you can use to - [Scala Project](scala/README.md) - [Python Project](python/README.md) -Note: We will be coding in Scala for the Hours with Experts course but for this challenge you can choose any language you like. +Note: We will be coding in Python for the Hours with Experts course and strongly recommend you submit your code in python, but you are welcome to choose any language you would like and we'll take that into account. #### Important When you are ready to start working on your solution, create a new branch called - yournameChallengeThree - ex) nickraffertyChallengeThree From cd2b67a6405bf3e5019a689b008c8fd09d299321 Mon Sep 17 00:00:00 2001 From: KavVij Date: Sun, 8 Sep 2024 21:14:08 -0500 Subject: [PATCH 2/6] first done --- github/funfacts/Spring2022/Kavitha/untitled.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 github/funfacts/Spring2022/Kavitha/untitled.txt diff --git a/github/funfacts/Spring2022/Kavitha/untitled.txt b/github/funfacts/Spring2022/Kavitha/untitled.txt new file mode 100644 index 00000000..e69de29b From 00ffab642882b762fe108be40b32a68b28c0904f Mon Sep 17 00:00:00 2001 From: KavVij Date: Sun, 8 Sep 2024 21:21:24 -0500 Subject: [PATCH 3/6] fun fact added --- github/funfacts/Spring2022/Kavitha/untitled.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/github/funfacts/Spring2022/Kavitha/untitled.txt b/github/funfacts/Spring2022/Kavitha/untitled.txt index e69de29b..a5eb22a3 100644 --- a/github/funfacts/Spring2022/Kavitha/untitled.txt +++ b/github/funfacts/Spring2022/Kavitha/untitled.txt @@ -0,0 +1,2 @@ +funfact.text +Not a workout freak but now going for boxing classes \ No newline at end of file From feaccdb278f3609bf69f54b87587a5812e53a7d7 Mon Sep 17 00:00:00 2001 From: KavVij Date: Sun, 8 Sep 2024 21:25:57 -0500 Subject: [PATCH 4/6] text name --- github/funfacts/Spring2022/Kavitha/{untitled.txt => funfact.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename github/funfacts/Spring2022/Kavitha/{untitled.txt => funfact.txt} (100%) diff --git a/github/funfacts/Spring2022/Kavitha/untitled.txt b/github/funfacts/Spring2022/Kavitha/funfact.txt similarity index 100% rename from github/funfacts/Spring2022/Kavitha/untitled.txt rename to github/funfacts/Spring2022/Kavitha/funfact.txt From 15e4832f7b69621a2ff9e4af76b0d9e5998b3970 Mon Sep 17 00:00:00 2001 From: KavVij Date: Sun, 8 Sep 2024 21:31:43 -0500 Subject: [PATCH 5/6] funfact name --- github/funfacts/Spring2022/Kavitha/funfact.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/funfacts/Spring2022/Kavitha/funfact.txt b/github/funfacts/Spring2022/Kavitha/funfact.txt index a5eb22a3..87377dec 100644 --- a/github/funfacts/Spring2022/Kavitha/funfact.txt +++ b/github/funfacts/Spring2022/Kavitha/funfact.txt @@ -1,2 +1,2 @@ -funfact.text +Kavitha Not a workout freak but now going for boxing classes \ No newline at end of file From 177bca52d754694fcf99c3333dbcb7229417cda6 Mon Sep 17 00:00:00 2001 From: KavVij Date: Sun, 8 Sep 2024 23:25:20 -0500 Subject: [PATCH 6/6] challenge3 --- python/secret_recipe_decoder.py | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/python/secret_recipe_decoder.py b/python/secret_recipe_decoder.py index 813f2f7a..2193e381 100755 --- a/python/secret_recipe_decoder.py +++ b/python/secret_recipe_decoder.py @@ -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)