I want to write a program that determines the amount of prime numbers less than or equal to N (variable containing user input). This is what I've got:
N = int(input("Enter number: "))
count = 0
primes = []
for i in range(2, N+1):
for j in range(2, int(i/2)+1):
if (i % j) != 0:
primes += [i]
count += 1
print(count)
print(primes)
But when I run the code, it doesn't take the numbers 2 and 3 to be prime. How can I fix this program?