How to test a variable against multiple values in Python

1 Answer

0 votes
n = 3

if n in (1, 2, 3, 4, 5, 6):
  print("found")
else:
  print("Not found")



'''
run:

found

'''

 



answered Sep 25, 2019 by avibootz

Related questions

...