Upper Lower Function In Python Definition