I am currently writing a program that takes an integer, n, from a user, and outputs all of the prime numbers up to and including n. I have written the following code, and am not sure where I am going wrong. For some reason, my program isn’t responding to the fact that x is going up 1 each time, and therefore isn’t working. Here is the code:
n=int(input(‘Enter a number:’))
for i in range(2,(n+1)):
if i==(((6x)-1) or ((6x)+1)):
Please let me know where I’m going wrong, and how I can fix this!