Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Tacos Al Pastor
Jun 20, 2003

Python related question (I'm using Python 3). Why does the following set the items out of order?

master_set = set(input("Enter your string: ").split())#Get input
print(master_set)

I enter the string: This is a string and get the following as output:

Enter your string: this is a string
{'this', 'a', 'is', 'string'}

It should be: {'this', 'is', 'a', 'string'} right? Why is it out of order?

:confused:

edit: removing set() from the input line above fixed it. But Im still a bit confused why.

Tacos Al Pastor fucked around with this message at 23:53 on Apr 16, 2014

Adbot
ADBOT LOVES YOU

Tacos Al Pastor
Jun 20, 2003

SurgicalOntologist posted:

Sets have no order. If you want order, use a list. If you want order and no duplicates, use the keys of an OrderedDict:
http://stackoverflow.com/questions/9792664/python-set-changes-element-order

For this particular problem, Im to read input into a set but this definitely helps as I have to take that input and add it to a dict later and keep track of the number of times the word appears using the key for that dict.

Thanks

Tacos Al Pastor
Jun 20, 2003

More of a documentation question: What is the process for generating system req's for an app? (minimum). Does anyone have experience with writing these?

Tacos Al Pastor
Jun 20, 2003

TooMuchAbstraction posted:

Everyone knows that system requirements are bullshit to some extent, so you shouldn't feel like you need to get them "correct".

This is kind of how I feel about it too. Even a processor from 15 years ago can run a lot of applications.

leper khan posted:

what is the lowest spec thing youve tested it with? what is its worst case resource usage?

So yeah thats the thing. Having the lowest benchmarked item to test with. Im not even sure how to deduce that without having it in hand

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply