How to use bool slots to determine the output of the chatbot?

I have several slots of type: bool and i want the bot to output a message depending on how many of these slots have been set to true and how many have been set to false (say 2 out of the 4 severe symptoms are set to true would result in an answer some_severe_symptoms). I am pretty new to python and i am struggling with writing an action that will do this.

I have set the slots to be true or false through button payloads in the domain file, however i dont know how to go about creating the action to do this.

slots example:

  severe_symptom_1:
    type: bool
  severe_symptom_2:
    type: bool
  severe_symptom_3:
    type: bool
  severe_symptom_4:
    type: bool
  moderate_symptom_1:
    type: bool
  moderate_symptom_2:
    type: bool
  moderate_symptom_3:
    type: bool
  moderate_symptom_4:
    type: bool

button payloads example:

utter_severe_symptom_1:
  - text: "Are you noticeably breathless and can do very little ?"
    buttons:
      - title: "yes"
        payload: '/affirm{"severe_symptom_1": true}'
      - title: "No"
        payload: '/deny{"severe_symptom_1": false}'

action example

class ActionHowManySymptoms(Action):

	def name(self) -> Text:
		return "action_how_many_symptoms"

	def run (self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

		severe_symptom_1 = tracker.get_slot("severe_symptom_1")
		severe_symptom_2 = tracker.get_slot("severe_symptom_2")
		severe_symptom_3 = tracker.get_slot("severe_symptom_3")
		severe_symptom_4 = tracker.get_slot("severe_symptom_4")

		moderate_symptom_1 = tracker.get_slot("moderate_symptom_1")
		moderate_symptom_2 = tracker.get_slot("moderate_symptom_2")
		moderate_symptom_3 = tracker.get_slot("moderate_symptom_3")
		moderate_symptom_4 = tracker.get_slot("moderate_symptom_4")

		if severe_symptom_1 == true and severe_symptom_2 == true and severe_symptom_3 == false and severe_symptom_4 == false:
			dispatcher.utter_template('utter_some_severe_symptoms')
		elif severe_symptom_1 == true and severe_symptom_2 == false and severe_symptom_3 == false and severe_symptom_4 == false:
			dispatcher.utter_template('utter_one_severe_symptoms')
		elif severe_symptom_1 == false and severe_symptom_2 == false and severe_symptom_3 == false and severe_symptom_4 == false:
			dispatcher.utter_template('utter_no_severe_symptoms')

I dont know if this is correct or if need to do something differently. Thanks for taking time out of your schedule to look at this.

I think you could create a list of your symptoms and count number of True values, e.g.: Counting the number of True Booleans in a Python List - Stack Overflow