Looks like you're comparing strings:
>>> "10" < "2"
True
Compare their integer version:
if int(s.get("home")) < int(s.get("away"))
If the key is missing from the dict then dict.get
returns None
by default. You can also pass your own default value.
home_score = int(s.get("home", 0)) # or choose some other default value
away_score = int(s.get("away", 0))
if home_score < away_score:
#do something
Demo:
>>> int("10") < int("2")
False