For project Euler problem -1 one python solution is given here:
http://www.s-anand.net/euler.html
The meaning of the statement "if not i % 5 or not i % 3" is "if i divides 3 or 5 or both then n = n + 1".
If i%j == 0 is true then "not (i%j)" evaluates to True.
http://www.s-anand.net/euler.html
The meaning of the statement "if not i % 5 or not i % 3" is "if i divides 3 or 5 or both then n = n + 1".
If i%j == 0 is true then "not (i%j)" evaluates to True.
No comments:
Post a Comment