Python prime superposition for statement question

Asked 2 years ago, Updated 2 years ago, 80 views

You want to take an integer n and add a decimal number to the list L that is greater than n*2, but if you enter 16 in n, you only run up to 17 and not more. What I want is to turn from 17 to 31 and add a few of them to the list. I have no idea what the problem is.

python for

2022-09-20 16:26

1 Answers

Unfortunately, the code was uploaded as an image, so I couldn't run itHowever, with a high probability, primeChk = True initialization should be performed in the section just before fori appears. Otherwise, guess what, primeChk=false has not been initialized and reused twice since primeChk Ffalse reallocation occurred, so any i will no longer be append(). This is especially true if you change the variable name to something like is_i_prime_number.

Or you can't, but try it, and if it doesn't work, copy the code into text and upload it again.


2022-09-20 16:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.