I am working on problem set #2 question number 1 and I cannot figure out how to compute all possible permutations of the variables I have created... http://pastebin.com/u4Dac2gK It is not finished yet, but I think I will need to set up three while loops to test each set of permutations and then add one to the base variable each time.

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

I am working on problem set #2 question number 1 and I cannot figure out how to compute all possible permutations of the variables I have created... http://pastebin.com/u4Dac2gK It is not finished yet, but I think I will need to set up three while loops to test each set of permutations and then add one to the base variable each time.

MIT 6.00 Intro Computer Science (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

nested loops should work
alright so I gave a try to nest loops within each other and I ended up with an interesting mess. The pastebin file has been updated with the current version of the code including the 3 nested loops I made. What exactly is going wrong here http://pastebin.com/u4Dac2gK
at line 48, try- while not foundCombination http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#testing-for-truth-values for loops work too: http://pastebin.com/KCjVreHh http://docs.python.org/tutorial/controlflow.html#for-statements

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

I like how you used those for nested for loops, I am going to re-write the code with it and then I will put it up on pastebin for criticism. Thanks for the help.
alright I am all finished with my new code. I have to say this ps taught me so much, and thank you so much for your help with xrange()... I wanted to know where I could find out more about the function and figure out how it is working. code is here, take a look and criticize. http://pastebin.com/u4Dac2gK
The Python documentation should be installed on your computer - I think it is easier to use than the on-line version. xrange is a built-in function. reading the documentation is a must, especially the tutorial. If you are using windows and Idle, you should be able to access the documentation with F1 from within Idle. . here is the on-line link (Python v2.72) http://docs.python.org/ . xrange: http://docs.python.org/library/functions.html#built-in-functions

Not the answer you are looking for?

Search for more explanations.

Ask your own question