A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 4 years ago
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.
anonymous
 4 years ago
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.

This Question is Closed

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0nested loops should work

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0alright 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

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0at line 48, try while not foundCombination http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#testingfortruthvalues for loops work too: http://pastebin.com/KCjVreHh http://docs.python.org/tutorial/controlflow.html#forstatements

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0I like how you used those for nested for loops, I am going to rewrite the code with it and then I will put it up on pastebin for criticism. Thanks for the help.

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0alright 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

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0The Python documentation should be installed on your computer  I think it is easier to use than the online version. xrange is a builtin 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 online link (Python v2.72) http://docs.python.org/ . xrange: http://docs.python.org/library/functions.html#builtinfunctions
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.