Skip to content

Birmingham | 2026-MAR-SDC | Joy Opachavalit | Sprint 4 | Implement-cowsay#409

Open
enjoy15 wants to merge 2 commits intoCodeYourFuture:mainfrom
enjoy15:implement-cowsay
Open

Birmingham | 2026-MAR-SDC | Joy Opachavalit | Sprint 4 | Implement-cowsay#409
enjoy15 wants to merge 2 commits intoCodeYourFuture:mainfrom
enjoy15:implement-cowsay

Conversation

@enjoy15
Copy link
Copy Markdown

@enjoy15 enjoy15 commented Mar 21, 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

Completed all exercises

@enjoy15 enjoy15 added 📅 Sprint 4 Assigned during Sprint 4 of this module Module-Tools The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 21, 2026
@davidlaucw davidlaucw added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 22, 2026
Copy link
Copy Markdown

@davidlaucw davidlaucw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's almost perfect, except for the two tiny points I mentioned. Good job.

Comment thread implement-cowsay/cow.py Outdated
message = " ".join(args.message)

# Get the animal function dynamically
animal_function = getattr(cowsay, args.animal, cowsay.cow)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to define the default value here again? It was set in line 11.
Also, instead of getattr, you may use cowsay.char_funcs described in the library documentation: https://github.com/VaasuDevanS/cowsay-python/tree/main#more-characters

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced getattr(...) with cowsay.char_funcs[args.animal].

Comment thread implement-cowsay/cow.py Outdated
animal_function = getattr(cowsay, args.animal, cowsay.cow)

# Print the message using the selected animal
print(animal_function(message))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need print here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the extra print(...) and now call the selected cowsay function directly.

@davidlaucw davidlaucw added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Apr 22, 2026
@enjoy15 enjoy15 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 23, 2026
@davidlaucw
Copy link
Copy Markdown

Excellent 👍

@davidlaucw davidlaucw added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. Module-Tools The name of the module. 📅 Sprint 4 Assigned during Sprint 4 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants