This is a very basic program in python for checking whether a given number is odd or even.
__author__ = 'coder' def OddEven(number): try: remainder = number % 2 if number == 0: print "Number is Zero" elif remainder == 0: print "Number is Even" else: print "Number is Odd" except: print "Error while processing" if __name__ == '__main__': OddEven(11)
No comments:
Post a Comment