Help us understand the problem. What is going on with this article?

プログラミング初心者がProject Eulerを解いてみた。1

Problem1

10未満の自然数のうち, 3 もしくは 5 の倍数になっているものは 3, 5, 6, 9 の4つがあり, これらの合計は 23 になる。
同じようにして, 1000 未満の 3 か 5 の倍数になっている数字の合計を求めよ。

解答

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

#233168

if
pythonの本を見ながらやったらできました。
1問目は、本の序盤に習うものでできたのでよかったです。


自分が参考にしている本はこちらです↓

独学プログラマー Python言語の基本から仕事のやり方まで

初心者の方向けのすごくわかりやすく丁寧な説明なので、プログラミング.pythonを初めて勉強する方はおすすめです。(この本しか読んだことありませんが...)

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away