Consider merging these comparisons with 'in' by using 'coluna in (7, 8, 9)'. Use a set instead if elements are hashable.
27
28 else:
29 familia = "B"
30 if coluna == 7 or coluna == 8 or coluna == 9:31 coluna = 7
32 elif coluna == 10:
33 coluna = 0
Description
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.
Bad practice
if x == 1 or x == 2 or x == 3:
do_something()
Recommended
if x in (1, 2, 3):
do_something()