Leetcode Design Hashmap Python Syntax If Else