Skip to content

Instantly share code, notes, and snippets.

@ZechCodes
Last active October 26, 2020 01:56
Show Gist options
  • Save ZechCodes/53f608fb636b99fd78d8f18cedca712c to your computer and use it in GitHub Desktop.
Save ZechCodes/53f608fb636b99fd78d8f18cedca712c to your computer and use it in GitHub Desktop.
Challenge 139 - Halloween Day

Challenge 139 - Halloween Day

Create a function that takes date in the format yyyy/mm/dd as an input and returns "Trick or Treat" if the date is October 31, else return "Trick".

Examples

halloween("2013/10/31") ➞ "Trick or Treat"

halloween("2012/07/31") ➞ "Trick"

halloween("2011/10/12") ➞ "Trick"
import unittest
def halloween(date: str) -> str:
return "" # Put your code here!!!
class Test(unittest.TestCase):
def test_1(self):
self.assertEqual("Trick or Treat", halloween("2013/10/31"))
def test_2(self):
self.assertEqual("Trick", halloween("2012/07/31"))
def test_3(self):
self.assertEqual("Trick or Treat", halloween("2015/10/31"))
def test_4(self):
self.assertEqual("Trick", halloween("2011/10/12"))
def test_5(self):
self.assertEqual("Trick", halloween("2008/10/11"))
if __name__ == "__main__":
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment