Skip to content

Instantly share code, notes, and snippets.

@Abhishek-Srivastava
Created May 5, 2013 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Abhishek-Srivastava/5520258 to your computer and use it in GitHub Desktop.
Save Abhishek-Srivastava/5520258 to your computer and use it in GitHub Desktop.
'''
Created on Apr 25, 2013
@author: abhsriva
'''
class Do_Mathematics:
def __init__(self, a, b):
self.a = a
self.b = b
def sum(self):
return self.a+self.b
def sub(self):
return self.a-self.b
def check_greater(self):
if self.a > self.b:
print "a is greater"
else:
print "b is greater"
def _check_if_zero(self, num):
if num == 0:
return True
return False
def div(self):
if self._check_if_zero(self.b):
print 'Can\'t divide'
else:
return float(self.a)/self.b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment