Skip to content
Advertisement

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 Thanks Answer Yet another version of this

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 common factors and then add the coprime to the list if

web-scraping error message: ‘int’ object has no attribute ‘get’

Hello Stack Overflow contributors! I want to scrape multiple pages of a news website; it shows an error message during this step The error message is The lines of code are More specifically, this page and pages next to it are what I want to scrape: https://nypost.com/search/China+COVID-19/page/1/?orderby=relevance Any helps would be greatly appreciated!! Answer For me this code runs okay.

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’m increasing

Advertisement