Skip to content

Tag: for-loop

Iteration numbers with True False condition

Please HELP!! I have a list: I want to generate iteration number if it’s False the number continues and if it’s True the number stays. I Try this code: it’s just keep running and did not show any output. the desired output will be [1,2,3,3,3,4,5,6,6] I have no idea what’s wrong with it…

How to stop loop running out of memory?

I’ve come back to programming after a long haitus so please forgive any stupid errors/inefficient code. I am creating an encryption program that uses the RSA method of encryption which involves finding the coprimes of numbers to generate a key. I am using the Euclidean algorithm to generate highest comm…

Python dynamic for loop range size

I’m trying to add Link argument to ini file by using python. Example of ini file: I need to do like this: My for loop: My code works, but it does not add Link for last tags. I’ve found why. If I add in range(len(m)+100): Then code adds all Links. Looks like len(m) is old value (static?), because I…