Which logic for if-else inside a function is better or more pythonic?
The logic between f1 and f2 is exactly the same, but the syntax is slightly different. This type of function shows up everywhere. Is one easier to read, or preferred in some way?

Side note: I thought it was interesting that f2 is slightly faster than f1.

    import numpy as np
    
    arr = np.random.choice(['a','b','c'],100)
    
    def f1(cond):
        if cond == 'a':
            return 'a' 
        if cond == 'b':
            return 'b' 
        return 'c'
    
    def f2(cond):
        if cond == 'a':
            return 'a' 
        elif cond == 'b': 
            return 'b' 
        else:
            return 'c'

f1 timeit:

    In [1]: %%timeit
        ...: for i in arr:
        ...:     f1(i)
        ...: 
    40.6 µs ± 804 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)

f2 timeit:

    In [2]: %%timeit
        ...: for i in arr:
        ...:     f2(i)
        ...: 
    40.2 µs ± 729 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)

edit: u/hai_wim pointed out that the speeds are fully equal (difference is within stdev tolerance), as the byte code is exactly the same. So the question really comes down to readability and standardization.