Skip to content

Instantly share code, notes, and snippets.

@rubycarefree
Created August 9, 2022 15:08
Show Gist options
  • Save rubycarefree/0c40e8fdd2d1c124702a180b0454b3b0 to your computer and use it in GitHub Desktop.
Save rubycarefree/0c40e8fdd2d1c124702a180b0454b3b0 to your computer and use it in GitHub Desktop.
In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the month and the number of days in that month as parameters. Adapt the rest of the code so that the result is the same. Confirm your results by making a function call with the correct parameters for both months listed.
def month_days(month, days):
print(month, "has", days, "days.")
month_days("June","30")
month_days("July","31")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment