I searched for prime numbers in python

Introduction

Due to the influence of the coronavirus, I had nothing to do because the school was closed, so I made a program to find out prime numbers.

Source code

Prime_number_list=[]
b=input("Please specify the range to look for")
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)

Recommended Posts

I searched for prime numbers in python
Prime numbers in Python
[Python] I searched for various types! (Typing)
Prime number 2 in Python
Project Euler # 10 "sum of prime numbers" in Python
Find prime numbers in Python as short as possible
[Python] I searched for the longest Pokemon Shiritori
[Python 3] Prime factorization in 14 lines
I wrote python in Japanese
Search for strings in Python
Determine prime numbers with python
Techniques for sorting in Python
I searched for the skills needed to become a web engineer in Python
I made a prime number generation program in Python 2
Handle prime numbers in Python / Ruby / PHP / Golang (Go)
I understand Python in Japanese!
What I learned in Python
About "for _ in range ():" in python
Handle complex numbers in Python
I searched for CD commands.
Check for memory leaks in Python
Testing with random numbers in Python
Infinite prime number generator in Python3
I wrote Fizz Buzz in Python
I learned about processes in Python
I wrote the queue in Python
Law of large numbers in python
[Python] nCr mod Compute prime numbers
Run unittests in Python (for beginners)
I tried Line notification in Python
I wrote the stack in Python
I tried to create a list of prime numbers with python
I put Python 2.7 in Sakura VPS 1GB.
Project Euler # 3 "Maximum Prime Factors" in Python
I tried to implement permutation in Python
I made a payroll program in Python!
Notes on nfc.ContactlessFrontend () for nfcpy in python
Inject is recommended for DDD in Python
Tips for dealing with binaries in Python
I tried to implement PLSA in Python 2
Summary of various for statements in Python
Type annotations for Python2 in stub files!
Algorithm learned with Python 4th: Prime numbers
I tried using Bayesian Optimization in Python
Project Euler # 7 "1000 1st prime number" in Python
I can't debug python scripts in Eclipse
Template for writing batch scripts in python
Process multiple lists with for in Python
I implemented Cousera's logistic regression in Python
I tried to implement ADALINE in Python
MongoDB for the first time in Python
I wanted to solve ABC159 in Python
Get a token for conoha in python
AtCoder cheat sheet in python (for myself)
Python> Output numbers from 1 to 100, 501 to 600> For csv
Notes for using python (pydev) in eclipse
Tips for making small tools in python
Use pathlib in Maya (Python 2.7) for upcoming Python 3.7
Project Euler # 2 "Even Fibonacci Numbers" in Python
I created a password tool in Python.
Why can't I install matplotlib in python! !!