Skip to main content
Question Protected by CommunityBot
Tweeted twitter.com/#!/StackCodeReview/status/640123918657945600
deleted 3 characters in body
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

Challenge Description:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.
Source

I want to receive advice on my code.

total_sum = 0
for i in range(1000):
    if (i%3 == 0 or i%5 == 0):
        total_sum = total_sum+i
print total_sum

I want to receive an advice on my code.

Challenge Description:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.
Source

total_sum = 0
for i in range(1000):
    if (i%3 == 0 or i%5 == 0):
        total_sum = total_sum+i
print total_sum

I want to receive an advice on my code.

Challenge Description:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.
Source

I want to receive advice on my code.

total_sum = 0
for i in range(1000):
    if (i%3 == 0 or i%5 == 0):
        total_sum = total_sum+i
print total_sum
Improved Formatting
Source Link
Quill
  • 11.9k
  • 5
  • 40
  • 93

Euler_Project Project Euler #1: Multiples of 3 and 5

Challenge Description:

Python 2If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9.7 The sum of these multiples is 23.

 

[![Question][1]][1] Question link: https://projecteulerFind the sum of all the multiples of 3 or 5 below 1000.net/problem=1
Source

total_sum = 0
for i in range(1000):
    if (i%3 == 0 or i%5 == 0):
        total_sum = total_sum+i
print total_sum

I want to receive an advice foron my code... Thank you in advance! :D [1]: https://i.sstatic.net/zE82e.png

Euler_Project #1 Multiples of 3 and 5

Python 2.7

[![Question][1]][1] Question link: https://projecteuler.net/problem=1

total_sum = 0
for i in range(1000):
    if (i%3 == 0 or i%5 == 0):
        total_sum = total_sum+i
print total_sum

I want to receive an advice for my code... Thank you in advance! :D [1]: https://i.sstatic.net/zE82e.png

Project Euler #1: Multiples of 3 and 5

Challenge Description:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

 

Find the sum of all the multiples of 3 or 5 below 1000.
Source

total_sum = 0
for i in range(1000):
    if (i%3 == 0 or i%5 == 0):
        total_sum = total_sum+i
print total_sum

I want to receive an advice on my code.

Source Link
MTHL
  • 535
  • 1
  • 5
  • 6

Euler_Project #1 Multiples of 3 and 5

Python 2.7

[![Question][1]][1] Question link: https://projecteuler.net/problem=1

total_sum = 0
for i in range(1000):
    if (i%3 == 0 or i%5 == 0):
        total_sum = total_sum+i
print total_sum

I want to receive an advice for my code... Thank you in advance! :D [1]: https://i.sstatic.net/zE82e.png