jeudi 15 août 2019

best way to pull from file into elif statements with multiple conditions

What would be the best way to read a file and these strings with their "==" or "in" and "and" conditions.

I was thinking of doing json dict, but I cant figure out how to go about it.

if (msg == "how?" or
      msg == "how" or
      "available" in msg or
      "bankrupt" in msg or
      "interested" in msg) and (morning or afternoon):
    reply = response("hi")

elif (msg == "how?" or
      msg == "how" or
      "available" in msg or
      "bankrupt" in msg or
      "interested" in msg) and night:
    reply = response("hi")

elif (msg == "how?" or
      msg == "how" or
      "available" in msg or
      "bankrupt" in msg or
      "interested" in msg) and early_morning:
    reply = response("hi")

elif ("ir aver" in msg or
      "documentos" in msg or
      "itin" in msg or
      "pasaporte" in msg or
      u"número" in msg or
      "numero" in msg or
      "telefono" in msg or
      u"teléfono" in msg or
      u"dígame" in msg or
      u"digame" in msg or
      u"dirección" in msg or
      "contado" in msg or
      u"cuánto" in msg or
      "efectivo" in msg or
      "precio" in msg or
      "que piden" in msg or
      "ubicados" in msg):
    reply = response("hi")

Aucun commentaire:

Enregistrer un commentaire