Which is better practice for this if elif… else statement?
The following is better IMO. Duplicated &quot;A is odd&quot; / &quot;A is even&quot; strings are omitted from the output. They could be added if required.
if A % 2 == 0:
    if A % 6 == 0:
        msg = &quot;a multiple of 6 (6, 12, 18, 24, 30)&quot;
    elif A % 10 == 0:
        msg = &quot;a multiple of 10 (10, 20)&quot;
    else:
        msg = &quot;a number out of 2, 4, 8, 14, 16, 22, 26, 28&quot;
    print(f&quot;A is even and {msg}.&quot;)
else:
    if A % 3 == 0:
        msg = &quot;a multiple of 3 (3, 9, 15, 21, 27)&quot;
    else:
        msg = &quot;a number out of 1, 5, 7, 11, 13, 17, 19, 23, 25, 29&quot;
    print(f&quot;A is odd and {msg}.&quot;)

As for which one of the two versions of the provided code is better, I agree with @stefan's answer.