-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finds the mean of a list of numbers #82
base: main
Are you sure you want to change the base?
Conversation
Please, read this repo's contribution guidelines. If you had followed them, you'd know that your code doesn't work in its current form - the tests would show it.
|
Sums had a specific module in the stdlib, but were changed to a nimble package. See: nim-lang/Nim#18438 Anyway, I would keep a similar version with I second @ZoomRmc : tests from the documentation could be changed copied under the when isMainModule. when isMainModule:
discard |
## ```nim | ||
## echo mean(@[3, 6, 9, 12, 15, 18, 21]) | ||
## # Output: 12.0 | ||
## ``` | ||
## ```nim | ||
## echo mean(@[5, 10, 15, 20, 25, 30, 35]) | ||
## # Output: 20.0 | ||
## ``` | ||
## ```nim | ||
## echo mean(@[1, 2, 3, 4, 5, 6, 7, 8]) | ||
## # Output: 4.5 | ||
## ``` | ||
## ```nim | ||
## echo mean(@[]) | ||
## # Error: List is empty | ||
## ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this under the when isMainModule block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my answer in the conversation tab.
No description provided.