Last active
June 5, 2020 19:21
-
-
Save aheze/036d19aa56a375b8b03cee7f05508b3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # define the function | |
| def match_number(number, singular, plural): | |
| if number == 1: | |
| return str(number) + " " + singular # return the number + the singular noun | |
| else: | |
| return str(number) + " " + plural # return the number + the plural noun | |
| followers_count = 1 | |
| grammarized_followers = match_number(number = followers_count, singular = "follower", plural = "followers") | |
| print(grammarized_followers) # 1 follower |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment