New answers tagged

6

If this were for a job, I'd say you need to potentially translate the JSON soup into well-typed, well-defined models, but it's probably not. In that case, you should still break your logic up into functions with type hints. Note that there's an opportunity for early-break since you probably only care about the first entries found for your over/under and ...


5

I don't think you win something by avoiding loops in that case... Personally, I probably would just introduce a namedtuple, extract the processing of each game record to a function and use get(key) to access a value within a dict to avoid KeyErrors. If you want it to be more pythonic, maybe you could consider using list comprehensions. I don't think it's ...


Top 50 recent answers are included