Use negative index -1 to get the last element of sequence
Remove unnecessary use of comprehension
Remove unnecessary f-string
Fix incorrect f-string syntax
Replace multiple == checks with in
To check if a variable is equal to one of many values, combine the
values into a tuple and check if the variable is contained in it instead
of checking for equality against each of the values. This is faster,
less verbose, and more readable.
sys.exit()
calls-1
to get the last element of sequence==
checks within
To check if a variable is equal to one of many values, combine the values into a tuple and check if the variable is contained in it instead of checking for equality against each of the values. This is faster, less verbose, and more readable.
Signed-off-by: Vladislav Doster mvdoster@gmail.com