Hello all,
I hope you enjoyed today's class. On the topic of loops, I figure it is time to bring up a website that is pretty useful for implementing the skills we learn in this class: Project Euler. This website offers about 500 problems of varying difficulties for programmers to solve. I highly recommend you all check out the first problem (https://projecteuler.net/problem=1), as after today's class, you have the ability to solve it.
If you have any questions, please let us know either in this forum or via email.
Best,
Joseph
Have 2 variables: n and sum. Using a while loop, for all numbers under 1000, if the modulo of n and 3 is 0, add n/3, if the modulo of n and 5 is 0, add n/5.
n=0 sum=0 while(<condition>): if(n%3==0): <add all multiples of 3 to sum> elif(n%5==0): <add all multiples of 5 to sum> <change n> print(sum)
What would you do to find the sum of the list? I found the list of multiples of 3 and 5, but don't know how to find the sum.