def get_search_url(from_, to): return f"http://thesite.com/Search?SO0={from_}&SD0={to}&SD1={from}&NA=false" # pls note `from_` vs `from` ^^^^^^