lundi 23 septembre 2019

How do I understand an assert error to clear a problem?

I don't understand the assert error so I can make the proper adjustments. I think I fixed, which I obviously didn't, so I am looking for direction on which way I need to go to course correct.

I have rewritten in multi0ple times and wonder if I am getting stuck on (if, else) as that was the assignment

''''python

if living == "commuting":
    living = "a commuter." 
else:
    living = "living in the dorms."
print("You said that you were a " + status + " student, who will be " + living)

if status == "in-state":
    SEMESTER_TUITION_FEES = SEMESTER_IN_STATE 
else:
    SEMESTER_TUITION_FEES = SEMESTER_OUT_OF_STATE 

if living == "commuting":
    SEMESTER_ROOM_BOARD = SEMESTER_ROOM_BOARD_COMMUTERS

elif living == "resident":
    SEMESTER_ROOM_BOARD = SEMESTER_ROOM_BOARD_RESIDENTS

'''' ''''assert

code check block - don't change this cell.

assert (status == 'in-state' and SEMESTER_TUITION_FEES == SEMESTER_IN_STATE or
        status == 'out-of-state' and SEMESTER_TUITION_FEES == SEMESTER_OUT_OF_STATE)
assert (living == 'commuting' and SEMESTER_ROOM_BOARD == 0 or
        living == 'resident' and SEMESTER_ROOM_BOARD == SEMESTER_ROOM_BOARD_RESIDENTS)

I am supposed to print a small sentence based on the "living" variable and the "status" variable from a previous section. To which I also have to match SEMESTER_TUITION_FEES, and SEMESTER_ROOM_BOARD (by in-state or out-of-state.

Error:
AssertionError                            Traceback (most recent call last)
<ipython-input-13-809d2b5a3dc7> in <module>
      3         status == 'out-of-state' and SEMESTER_TUITION_FEES == SEMESTER_OUT_OF_STATE)
      4 assert (living == 'commuting' and SEMESTER_ROOM_BOARD == 0 or
----> 5         living == 'resident' and SEMESTER_ROOM_BOARD == SEMESTER_ROOM_BOARD_RESIDENTS)

AssertionError:

Aucun commentaire:

Enregistrer un commentaire