n = int(input())
ln = list()
for i in range(2, n+1):
isPrime = True
for j in range(2, (i**0.5+1)):
if (i%j == 0):
isPrime = false
if isPrime:
ln.append(i)
ln.reverse()
print(*ln)
I dont know the answer, so yeah
HE.
n = int(input())
ln = list()
for i in range(2, n+1):
isPrime = True
for j in range(2, (i**0.5+1)):
if (i%j == 0):
isPrime = false
if isPrime:
ln.append(i)
ln.reverse()
print(*ln)
an somebody help me???
Patients is key… Also you pit this topic in the wrong category
What exactly are you trying to do? This post doesn’t give any description of the problem.
isPrime = False
False
is a keyword, type False
instead of ‘false’ in the code after checking divisibility of i
with j
please put your code into a code block by putting ```py
before your code and ``` after.
It makes the code format properly and have syntax highlighting, like this:
def say_hello_world(times):
for x in range(1, times):
print("Hello, world")
say_hello_world(1)
(Yes I actually enjoyed writing that code)
Are you trying to say that your code is not running as intended?
isPrime = False
Type F in caps for false
What is the purpose of your text? Plus please format the code.
@Winstenna Can you send a like to your code? Or if @QwertyQwerty54 is able to find it like she always does .
Lol, looks like they already fixed it based on a different post they made. That post has been unlisted now.
But after a quick look at their Repls I couldn’t find this one.
Lol nice good find
If this is a school assignment there’s not much we can do.