Hi. I've got a question on PS3b. I've attached the code.
My question is about the play_games function(toward the bottom of the code):
Under the "if choose == 'n' or choose == 'r':" How can I get the program to produce a new handz (randomly generated hand) when the user selects 'n', but keep the previous handz (the hand that was generated on the previous while loop) when the user selects 'r'?
Right now when the user selects 'r', handz generates a new random hand.
MIT 6.00 Intro Computer Science (OCW)
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
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.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
Whoops here is the code
pls use line numbers when referring to lines of code so we can find them easier.
maybe use if/elif/else??
Thanks bwCA. The code I am referring to is in 425-434.
Here is the result I am getting.
After I enter 'n' in the raw_input, the program generates a new random hand(line 6). Then after the play_hand functions runs (line 8) the program goes to the beginning of the while loop (line 9). At this point when I enter 'r', I would like the program to show the same hand in line 6. but instead it shows a new one (line 10).
How can I fix this problem and get 'r' to produce the same hand as 'n'?