# Evenodd.py (c) Kari Laitinen # http://www.naturalprogramming.com # 2006-03-02 File created. # 2006-05-27 Last modification. # A comma at the end of a print statement specifies # that a newline should not be printed after the sentence. # Operator % is the remainder operator in Python. print "\n This program can find out whether an integer" \ "\n is even or odd. Please, enter an integer: ", integer_from_keyboard = int( raw_input() ) if integer_from_keyboard % 2 == 0 : print "\n %d is even." % integer_from_keyboard else : print "\n %d is odd." % integer_from_keyboard