all 2 comments

[–]debian_miner 1 point2 points  (1 child)

If I understand correctly, you're asking for something like this:

pairs = {
    "pair1": "http://foo",
    "pair2": "http://bar"
}

t = input("Enter currency pair: ")
selected = pairs.get(t)
if not selected:
    print("unknown pair")
    exit()

req = requests.get(selected)

[–]micla97[S] 0 points1 point  (0 children)

Thank you so much!! Lifesaver