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 aacddf6 commit c2d9fc9Copy full SHA for c2d9fc9
1 file changed
implement-cowsay/cow.py
@@ -17,11 +17,11 @@ def main():
17
# Combine the message into a single string
18
message = " ".join(args.message)
19
20
- # Get the animal function dynamically
21
- animal_function = getattr(cowsay, args.animal, cowsay.cow)
+ # Get the animal function from the library mapping
+ animal_function = cowsay.char_funcs[args.animal]
22
23
- # Print the message using the selected animal
24
- print(animal_function(message))
+ # Display the message using the selected animal
+ animal_function(message)
25
26
if __name__ == "__main__":
27
main()
0 commit comments