def swap_columns(df, col1, col2):
    """Swaps the two given columns of the DataFrame."""
    col_list = list(df.columns)
    a, b = col_list.index(col1), col_list.index(col2)
    col_list[b], col_list[a] = col_list[a], col_list[b]
    return df[col_list]