Professional Documents
Culture Documents
797 PDFsam PythonNotesForProfessionals
797 PDFsam PythonNotesForProfessionals
Here, we use the in operator to test if the value is present in a tuple containing the values we want to compare
against.
if a == 1 or 2 or 3:
if a in (1, 2, 3):
# script.py
import sys
print(sys.argv[0])
print(sys.argv)
$ python script.py
=> script.py
=> ['script.py']
x = 7
x.bit_length()
# Out: 3