The pythonic approach

Timo Virkkala a at a.invalid
Wed Sep 15 03:31:08 EDT 2004


def thisReallyWorks(x):
     if x == "6$":
         return "$10 000"
     else:
         return x

# or maybe

investments = {"6$": "$10 000"}
def thisReallyWorks(x):
     return investments.get(x, x)


-- 
Timo "WT" Virkkala

   "In the battle between you and the world, bet on the world."



More information about the Python-list mailing list