startswith works with a tuple

This commit is contained in:
Rangi 2022-09-30 16:55:35 -04:00
parent f76f5c3583
commit 70a3ec1acc

View File

@ -28,7 +28,7 @@ def main():
if print_bank not in {'all', 'none'}: if print_bank not in {'all', 'none'}:
try: try:
print_bank = (int(print_bank[2:], 16) print_bank = (int(print_bank[2:], 16)
if print_bank.startswith('0x') or print_bank.startswith('0X') if print_bank.startswith(('0x', '0X'))
else int(print_bank)) else int(print_bank))
except ValueError: except ValueError:
error = f'Error: invalid BANK: {print_bank}' error = f'Error: invalid BANK: {print_bank}'