From dc122108ec115dd567ee7e05adbedfe3bf5a98de Mon Sep 17 00:00:00 2001 From: Jacque Goupil <1er@live.ca> Date: Wed, 31 Oct 2018 14:33:15 -0400 Subject: [PATCH] Fixed 'y' or 'yes' comparisons --- Fifty Fizzbuzzes.ipynb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Fifty Fizzbuzzes.ipynb b/Fifty Fizzbuzzes.ipynb index b644fe5..558e4e8 100644 --- a/Fifty Fizzbuzzes.ipynb +++ b/Fifty Fizzbuzzes.ipynb @@ -520,7 +520,7 @@ "\n", "while ask == \"n\": ask = input(\"oh come on it'll be fun! Play a game y/n? \")\n", " \n", - "if ask == (\"y\" or \"yes\"): \n", + "if ask in (\"y\", \"yes\"): \n", " print(\"Hooray! Let's play!\")\n", "else: \n", " print(\"I'll take that as a yes.\")\n", @@ -586,7 +586,7 @@ "\n", "while ask == \"n\": ask = input(\"oh come on it'll be fun! Play a game y/n? \")\n", " \n", - "if ask == (\"y\" or \"yes\"): \n", + "if ask in (\"y\", \"yes\"): \n", " print(\"Hooray! Let's play!\")\n", "else: \n", " print(\"I'll take that as a yes.\")\n", @@ -677,7 +677,7 @@ "\n", "while ask == \"n\": ask = input(\"oh come on it'll be fun! Play a game y/n? \")\n", " \n", - "if ask == (\"y\" or \"yes\"): \n", + "if ask in (\"y\", \"yes\"): \n", " print(\"Hooray! Let's play!\")\n", "else: \n", " print(\"I'll take that as a yes.\")\n", @@ -1801,7 +1801,7 @@ "\n", "while ask == \"n\": ask = input(\"Too scared? Come on. Play a game y/n? \")\n", " \n", - "if ask == (\"y\" or \"yes\"): \n", + "if ask in (\"y\", \"yes\"): \n", " print(\"\\nBEWARE! YOU ARE ENTERING FIZZ DUNGEON!\\n\")\n", "else: \n", " print(\"\\nFizz dungeon is full of mysteries. \\nYou cannot resist, despite the danger.\\n\")\n", @@ -2218,7 +2218,7 @@ " print(\"\\n\\nYOU DIE\\n\")\n", " play(bloo)\n", " a = input(\"Dare you attempt the dungeon again? y/n: \")\n", - " if a.lower() == (\"y\" or \"yes\"): \n", + " if a.lower() in (\"y\", \"yes\"): \n", " descend()\n", " else:\n", " return\n", @@ -2328,7 +2328,7 @@ "\n", "while ask == \"n\": ask = input(\"Too scared? Come on. Play a game y/n? \")\n", " \n", - "if ask == (\"y\" or \"yes\"): \n", + "if ask in (\"y\", \"yes\"): \n", " print(\"\\nBEWARE! YOU ARE ENTERING FIZZ DUNGEON!\\n\")\n", "else: \n", " print(\"\\nFizz dungeon is full of mysteries. \\nYou cannot resist, despite the danger.\\n\")\n", @@ -2339,7 +2339,7 @@ "\n", "a = input(\"ready? \")\n", "\n", - "while a == (\"n\" or \"no\"): print(\"Just let me know when you're ready. How bout now? \")\n", + "while a in (\"n\", \"no\"): print(\"Just let me know when you're ready. How bout now? \")\n", "\n", "play(footsteps)\n", "print(\"You descend into fizz dungeon with naught but your wits and your trusty sword Fizz. \")\n",