class price_validation: STATE=[] def __init__(self, net_amount, max_price, min_price): self.net_amount=net_amount self.max_price=max_price self.min_price=min_price def max_price_to_net_amount(self): 'validating if max_price is greater than or equal to net_amount' if self.max_price is not None and self.max_price >= self.net_amount: price_validation.STATE=True return price_validation.STATE else: data_validation.STATE=False return price_validation.STATE def max_price_to_min_price(self): 'validating if max_price is greater than or equal to min_price' if self.max_price is not None and self.max_price >= self.min_price: price_validation.STATE=True return price_validation.STATE else: price_validation.STATE=False return price_validation.STATE def min_price_to_net_amount(self): 'validating if min_price is lesser than or equal to net_amount' if self.min_price is not None and self.min_price <= self.net_amount: price_validation.STATE=True return price_validation.STATE else: price_validation.STATE=False return price_validation.STATE firstcontract=price_validation(3000, 4000, 2000) firstcontract.max_price_to_net_amount()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question