Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

If always true when checking strings

I'm developing a chatbot project for college, and in the following code block, the first if is always going as a true value, no matter what. I really need help and don't know what to do, cause this project is due on monday.

def registeredClient():
 print('Olá, bem-vindo a WE-RJ Telecom!')
 userInputString = str(input('O que você precisa?\nCaso queira contratar ou trocar de plano escreva "Quero contratar" ou "Quero trocar de plano".\nCaso esteja com problemas de conexão, escreva "suporte".\nCaso queira seu boleto, digite "boleto":\n'))
 userInputString = userInputString.lower()
 if 'contratar' or 'trocar plano' or 'aumentar velocidade' or 'mudar plano' or 'velocidade' or 'plano' in userInputString:
 newPlanOption()
 elif 'suporte' or 'lenta' or 'internet lenta' or 'internet esta lenta' or 'problema' or 'velocidade' in userInputString:
 supportOption()
 elif 'boleto' or 'segunda via' or '2a via' or 'fatura' in userInputString:
 billingOption()
 else:
 print('Não foi posível entender a sua mensagem, seu atendimento será encerrado.')
 return False

Answer*

Draft saved
Draft discarded
Cancel

lang-py

AltStyle によって変換されたページ (->オリジナル) /