We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd4f33e commit 7125d1aCopy full SHA for 7125d1a
1 file changed
implement-cowsay/cow.py
@@ -10,18 +10,17 @@ def main():
10
description="Make animals say things"
11
)
12
13
- parser.add_argument("--animal", choices=animals, help="The animal to be saying things.")
+ parser.add_argument("--animal", choices=animals, default="cow",help="The animal to be saying things.")
14
parser.add_argument("message", nargs="+", help="The message to say.")
15
16
args = parser.parse_args()
17
18
# Join all message words into a single string
19
message = " ".join(args.message)
20
21
- if args.animal:
22
- cowsay.char_funcs[args.animal](message)
23
- else:
24
- cowsay.cow(message)
+ # Output the message using the selected animal or the default cow
+ cowsay.char_funcs[args.animal](message)
+
25
26
if __name__ == "__main__":
27
main()
0 commit comments