Avatar ·

How to check a few values ​​of the variable operator if?

📁 python, вопрос, пример, работа, проект

Hello! I work on a large project. But I will explain my question on a different example ...

Suppose I need to create a program that only knows how to get out of his temper)

but the user can write “output”, “output”, “Vyhod”, “Exit”, “Exit” or “DS [jl” ”(on the layout. 'Latin'), etc.

Then the code would look something like this

  vyhod =  input  ()   if  vyhod == :  expt ( 0 )   if  vyhod == :  expit ( 0 )   if  vyhod ==  '`` `` `` `Span>:  Exit ( 0 )     

and so on ...

So, how can this be reduced. For example, I tried to do it like:

   if> vyhod == , , :  exit ( 0 ) r  

and so

  if  vyhod == ; ; :  exit (