-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
More explanation of modulo #424
Comments
I agree. Would dropping it here be a reasonable alternative to explaining it? |
Either way would work from my perspective. It could be useful to know, so it may be worth introducing. However, that may make this lesson longer so I'm fine dropping it as well. |
There is a good example which shows either both of things which I miss here: the if/else statement and the example for modulo: There is one common use for the Modulo Operator: to find even or odd numbers eg in a range 1 to 10: for number in range(1, 10):
if(number % 2 != 0):
print(number) The lesson shows the boolean type but no example for the usage. If/else condition would be helpful to introduce at this point. Thus, both topics are great to include here. |
I would suggest to add the example of finding even or odd numbers where we introduced a list. https://datacarpentry.org/python-ecology-lesson/01-short-introduction-to-Python/#lists |
to find even number in a list datacarpentry#424 (comment)
The episode Short Introduction to Programming in Python notes that
I don't think most people would consider
modulo
to be a basic operator. I would recommend some more explanation of what modulo does.The text was updated successfully, but these errors were encountered: