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

  • Home
  • SEARCH
  • 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 8398075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:56:44+00:00 2026-06-09T20:56:44+00:00

This is the strange thing I noticed in Python sets. I read there is

  • 0

This is the strange thing I noticed in Python sets. I read there is no order in sets, but it does pop lower elements from 0 till 79 and later from 79 till 127. It does not pop the lower ones any more. Only after 128 comes in 79 is popped. Why is it like this?

Is there any alternative where I can use the ordered data structure in Python?
Why is it popping the lowest from 0 till 79 and not from 79 till 127?

>>s = set()
>>s.add(72)
>> s.add(74)
>> s.add(76)
>> s.pop()
72
>> s.add(79)
>> s.pop()
74
>> s.add(81)
>> s
set([81, 76, 79])
>> s.pop()
76
>> s.add(83)
>> s
set([81, 83, 79])
>> s.add(85)
>> s
set([81, 83, 85, 79])
>> s.pop()
81
>> s
set([83, 85, 79])
  • 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-09T20:56:46+00:00Added an answer on June 9, 2026 at 8:56 pm

    There is a “consistent” internal ordering depending on the insertion and removal of elements in dictionaries. See: http://docs.python.org/library/stdtypes.html#dict.items

    As far as I’m aware sets use the same hashing implementation and will most likely have the same ordering effects.

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

Sidebar

Related Questions

Noticed a strange thing today. I have some code like this in a project
I've experimented with JavaScript and noticed this strange thing: var s = hello world!;
I noticed a very strange thing in my application. There are two static const
I have noticed a strange thing that happens on my web app when the
I noticed a strange thing about OpenCV. I used one of the basic sample
I noticed quite a strange thing while trying to allocate a lot of memory
I just noticed a strange thing in MIDP 2.0 API: The HttpConnection class apidocs
I have noticed a strange thing happening in jQuery and wonder if anyone knows
Edit: There is a somewhat strange solution to this question. Check my answer posted
I've come across a strange thing in Firefox, which has become a problem to

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.