Horje
sang nguyen to python Code Example
sang nguyen to python
#Cach 1: Sang true false
prime = [True] * (n+1)
prime[0] = prime[1] = False
for i in range(2, n+1):
  if prime[i]:
    for j in range(i*i, n+1, i):
      prime[j] = False


#Cach 2: Sang ra so
prime = []
m = []
for i in range(2, n+1):
  if i not in m:
    prime.append(i)
    for j in range(i*i, n+1, i):
      m.append(j)




Python

Related
split dataset into train, test and validation sets Code Example split dataset into train, test and validation sets Code Example
DatetimeProperties' object has no attribute 'weekday_name' Code Example DatetimeProperties' object has no attribute 'weekday_name' Code Example
install virtual environment python mac Code Example install virtual environment python mac Code Example
malier module python Code Example malier module python Code Example
how to run python file from cmd in dockerfile Code Example how to run python file from cmd in dockerfile Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7