C
C
Coder 14482020-05-03 01:10:52
Python
Coder 1448, 2020-05-03 01:10:52

What is the 'or' operator for the string data type called in Python?

I can't find anything anywhere.
For example, I want to do this:
while a != 'next' or 'stop': blah blah blah...
But 'or' is only for the bool data type. Is there an 'or' operator for the string data type?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aRegius, 2020-05-03
@wows15

words_to_compare = ['дальше', 'стоп']
if a not in words_to_compare: ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question