1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

pythonで素数を探してみた

Posted at

#はじめに
コロナウイルスの影響で学校が休みになったままでやる事がなかったので素数を見つけ出すプログラムを作りました。
#ソースコード

Prime_number_list=[]
b=input("探す範囲を指定してください")
b=int(b)
for a in range(b):
    a=a+1
    number=0
    for i in range(a):
        if a%(i+1)==0:
            number+=1
    if number==2:
        Prime_number_list.append(a)
print(Prime_number_list)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?