Due Date: Monday September 25 by the end of the lab session
Educational goals of this lab - verify that every student can
(80 points) Description of the Problem:
Enter a bet: 50 The rolls were 2 and 3 You won $100
Enter a bet: 50 The rolls were 4 and 1 You won $100
# ask user for bet amount # call randint twice to get rolls # display results of rolls # figure payoff (here's where your logic goes) # print out payoff
You need to design the logic. Use indentations to show which statements belong with which if. Use boolean operators as much as possible! It will be simpler than doing nested if's. Some hints: you do NOT have to do exhaustive comparisons, like "if roll1 == 2 and roll2 == 2 or roll1 == 2 and roll2 == 4 ..." it would be huge! express your logic by looking for patterns. Think about your structure. Is it a series of independent if's or are they tied together? nested if's or not? Save this in a file called game4.py and use it on the next step.
You will need to use this import statement "from random import randint" before the start of the main function, and add two lines near the start of the program
roll1 = randint(1,6) roll2 = randint(1,6)roll1 and roll2 are integers in the range 1 to 6, inclusive.
Log off properly - you don't want your account misused by someone else!
Remember NOT to leave files on the local hard drives in this lab or anywhere else on campus! Make sure you save your projects on a portable storage device you take with you!