i am not able to figure out why python throws an error when i call this function.
In the code snippet below when i call set_greyLevel() python throws an error.
If i comment the function call it works fine.

Please help. Thanks in advance.

def set_greyLevel(self, grayScale):
        if grayScale == 0:
            return "#cecece"
        elif grayScale == 1:
            return "#a0a0a0"
        elif grayScale == 2:
            return "#787878"
        elif grayScale == 3:
            return "#505050"
        else:
            return  "#000"

   def test(self, grayScale):
        temp = set_greyLevel(grayScale)
        print temp

Recommended Answers

All 2 Replies

use temp = self.set_greyLevel(grayScale)

commented: thanks a lot +0

Wow you have really good eyes to catch that by the indentation.:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.