Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8135541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:27:18+00:00 2026-06-06T10:27:18+00:00

I want to do this: while list: for blah in blah: things list.remove(min(list)) Would

  • 0

I want to do this:

while list:
    for blah in blah:
        things
    list.remove(min(list))

Would this loop until all the items in list are removed? As i have it my code, it just loops through [list] times, and then returns from the function. I need a loop that will keep going until all the items of list are gone.

I should note, nothing inbetween (in the for loop) is processed until the last iteration.

By request, the entire algorithm as it runs:

def parsexlsx(address):
    bits = [] 
    i = 0
    while address:
        min_address = False
        for row in ws.iter_rows(row_offset=4,column_offset=3):
            c = row[2]
            d = row[3]
            if not d.internal_value:
                if min_address:     #we set it to true, then kept going until blank row
                    break           #bits is what you want it to be now
                bits = []           #reset bits every time we hit a new row
                continue            #this will just skip to next row

            for bits_cell in row[4:]:
                if bits_cell.internal_value:
                    bits.append(bits_cell.internal_value)
            if c.internal_value:
                if c.internal_value == min(address):
                    min_address = True
        address.remove(min(address))

    print bits
    return bits 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:27:21+00:00Added an answer on June 6, 2026 at 10:27 am

    You need to use a separate variable from bits to hold EVERY piece of data. bits gets reset throughout your code, so I would recommend using something like all_bits and change bits to min_addr_bits. Also, you need to make sure for EVERY row that isn’t blank, you append bits to all_bits. Example posted on request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been struggling with this for a while. Basically, I want to have two
I want to remove all empty strings from a list of strings in python.
I have made my own single chained/linked list. Now, if I want to delete/remove
I have a list of items, those are points of a route. This is
So far i have this code: function changeGeoLoc($a,$b,$c){ echo <ul style='list-style-type: none; display:inline;'>; while(list(,$geoloc)
How do I do the opposite of this: while((*i2s) & (1<<19)) usleep(10); I want
I've been at this for a while and want to know the best way
I am executing this statement under while (($data=fgetcsv($this->fin,5000,;))!==FALSE) Now what I want in else
I want to do something like this. while pressing the refresh button, it will
This whole Facebook access_token thing is driving me nuts. All I want to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.