From 70d3155f1c03bd6691a13c4fa04bc88d8ed0aff5 Mon Sep 17 00:00:00 2001 From: delmorallopez <124817272+delmorallopez@users.noreply.github.com> Date: Mon, 5 Jan 2026 16:28:08 +0000 Subject: [PATCH 1/3] requirements file --- implement-cowsay/requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 implement-cowsay/requirements.txt diff --git a/implement-cowsay/requirements.txt b/implement-cowsay/requirements.txt new file mode 100644 index 000000000..c6b9ffd0e --- /dev/null +++ b/implement-cowsay/requirements.txt @@ -0,0 +1 @@ +cowsay From 9c2819e1a737922788036ccf8ec6d80c81fb345c Mon Sep 17 00:00:00 2001 From: delmorallopez <124817272+delmorallopez@users.noreply.github.com> Date: Mon, 5 Jan 2026 17:14:45 +0000 Subject: [PATCH 2/3] cowsay review --- implement-cowsay/cow.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 implement-cowsay/cow.py diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py new file mode 100644 index 000000000..5e73fde9e --- /dev/null +++ b/implement-cowsay/cow.py @@ -0,0 +1,36 @@ +import argparse +import cowsay + +def main(): + # List of available animals (provided by the package) + animals = cowsay.char_names + + parser = argparse.ArgumentParser( + prog="cowsay", + description="Make animals say things" + ) + + parser.add_argument( + "message", + nargs="+", + help="The message to say." + ) + + parser.add_argument( + "--animal", + choices=animals, + default="cow", + help="The animal to be saying things." + ) + + args = parser.parse_args() + + message = " ".join(args.message) + + # Dynamically call the function for the chosen animal + animal_func = getattr(cowsay, args.animal) + print(animal_func(message)) + + +if __name__ == "__main__": + main() From 079079bc063f389065e8b499459ba3e1a421e132 Mon Sep 17 00:00:00 2001 From: delmorallopez <124817272+delmorallopez@users.noreply.github.com> Date: Wed, 7 Jan 2026 13:41:17 +0000 Subject: [PATCH 3/3] Remove none from output --- implement-cowsay/cow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py index 5e73fde9e..2707ca771 100644 --- a/implement-cowsay/cow.py +++ b/implement-cowsay/cow.py @@ -29,7 +29,7 @@ def main(): # Dynamically call the function for the chosen animal animal_func = getattr(cowsay, args.animal) - print(animal_func(message)) + animal_func(message) if __name__ == "__main__":