Skip to content

Commit 6b19405

Browse files
committed
cow.py task is done.
1 parent 4350f48 commit 6b19405

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

implement-cowsay/cow.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import argparse
2+
import cowsay
3+
4+
parser = argparse.ArgumentParser(description="Make animals say things")
5+
6+
parser.add_argument("message", nargs="+", help="the message to say.")
7+
8+
parser.add_argument("message", nargs="+", help="The message to say.")
9+
10+
parser.add_argument("--animal",
11+
choices=cowsay.char_names,
12+
help="The animal to be saying things.")
13+
14+
args = parser.parse_args()
15+
message = " ".join(args.message)
16+
args.animal == None
17+
animal = args.animal or "cow"
18+
(getattr(cowsay, animal)(message))

0 commit comments

Comments
 (0)