Skip to content

West Midlands | 26 March SDC | Iswat Bello | Sprint 4 | implement cowsay#495

Open
Iswanna wants to merge 2 commits into
CodeYourFuture:mainfrom
Iswanna:sprint4-implement-cowsay
Open

West Midlands | 26 March SDC | Iswat Bello | Sprint 4 | implement cowsay#495
Iswanna wants to merge 2 commits into
CodeYourFuture:mainfrom
Iswanna:sprint4-implement-cowsay

Conversation

@Iswanna
Copy link
Copy Markdown

@Iswanna Iswanna commented Apr 14, 2026

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Pull Request Summary

In this Pull request, I Implemented a command-line cowsay tool in Python that allows users to make animals say custom messages.

Changes

  • cow.py: New Python script using argparse for command-line argument parsing

    • Dynamically retrieves available animals from the cowsay library
    • Accepts --animal flag to select which animal speaks (defaults to "cow")
    • Takes message as positional arguments and joins them
    • Uses getattr() to dynamically call the appropriate animal function
  • requirements.txt: Added cowsay dependency

Features

  • ✓ Dynamic animal selection without hardcoding
  • ✓ Help text via --help flag
  • ✓ Default animal is "cow" if no --animal specified
  • ✓ Supports multi-word messages

Usage Examples

python3 cow.py Grass, delicious.
python3 cow.py --animal turtle Fish are cool!
python3 cow.py --help

Iswanna added 2 commits April 11, 2026 16:12
- Add .venv to ignore Python virtual environments
- Add *.class to ignore Java compiled class files
- Create cow.py with argparse for command-line argument parsing
- Support dynamic animal selection with --animal flag (defaults to "cow")
- Accept message as positional arguments and join them
- Use getattr() to dynamically call animal functions from cowsay library
- Fetch available animals from cowsay.CHARS instead of hardcoding
- Add requirements.txt with cowsay dependency
@Iswanna Iswanna added 📅 Sprint 4 Assigned during Sprint 4 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Tools The name of the module. labels Apr 14, 2026
@behnamkvl behnamkvl added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label May 12, 2026
@behnamkvl
Copy link
Copy Markdown

This implementation looks good to me and it works as expected.

@behnamkvl behnamkvl added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Tools The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 4 Assigned during Sprint 4 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants