How do I use a keyword as a variable name?

Add a single underscore to your preferred names: from_ and to_

(see PEP 8)

class ExchangeRates(JsonAware):
    def __init__(self, from_, to_, rate):
        self.from = from_
        self.to = to_
        self.rate = rate

Leave a Comment