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 dc469dd commit b90ef41Copy full SHA for b90ef41
1 file changed
implement-cowsay/main.py
@@ -8,13 +8,5 @@
8
parser.add_argument('message', type=str, help= 'please enter a message')
9
arg = parser.parse_args()
10
11
-valid_animals = cowsay.char_names
12
-
13
-if arg.animal in valid_animals:
14
- animal_func = getattr(cowsay, arg.animal)
15
- print(animal_func(arg.message))
16
17
-else:
18
- print(f"Error: '{arg.animal}' is not a valid animal.")
19
- print("Valid animals are:", ", ".join(valid_animals))
20
- sys.exit(1)
+animal_func = getattr(cowsay, arg.animal)
+print(animal_func(arg.message))
0 commit comments