Python Script
You only get to go on your field trip if you bring back a signed
permission slip. If you get to go on the
field trip, you get to choose between going to the history museum
and the art museum. In your program,
ask the user if they've brought back a signed permission slip. If
they have, then ask them a history
question. If they get it right, then tell them that they are going
to the history museum. If they get it
wrong, tell them they are going to the art museum. If the user
doesn't bring back a signed permission
slip, tell them they can't go on the field trip.
Sample Program Run #1
Did you bring back your signed permission slip(yes/no)?
no
Sorry, you aren't allowed to go on the field trip.
Sample Program Run #2
Did you bring back your signed permission slip(yes/no)?
yes
Which number amendment allowed women to vote in the US?
19
You will get to go to the history museum!
Sample Program Run #3
Did you bring back your signed permission slip(yes/no)?
yes
Which number amendment allowed women to vote in the US?
18
You will get to go to the art museum!
Note:
# python script permissionSlip = raw_input('Did you bring back your signed permission slip(yes/no)? ') if (permissionSlip == 'yes'): historyQues = int(raw_input('Which number amendment allowed women to vote in the US? ')) if (historyQues == 19): print('You will get to go to the history museum!') else: print('You will get to go to the art museum!') else: print("Sorry, you aren't allowed to go on the field trip.")
Get Answers For Free
Most questions answered within 1 hours.