### Control Structures : examine_numbers¶

In this program we will learn making an interactive program. At the start of execution program asks user to supply a number, and then tests it to find if its a multiple of 2 or 3 or None and prints this information out. User can enter any non numeric value to have program terminate.

In [3]:

```
###################################################
# Filename : examine_numbers #
# Purpose : To demonstrate console input and #
# usage of the following control structures #
# 1. if elif else #
# 2. while loop #
# Author : Niel S. #
# The English Tea Company LLC #
###################################################
#The main function: It drives the program.
def main():
#Prompt user to enter a number. Store the input
# and identify it with x
x = input("Enter a positive number: ")
#Test if 'x' is numeric, if yes then enter loop else go to statement after loop.
while (x.isnumeric()):
x = int (x)
if (x%2==0 and x%3==0):
print ('The number ',x,' is a multiple of both 2 and 3.')
elif x%2 == 0:
print ('The number ',x,' is a multiple of 2 but not 3')
elif x%3 == 0:
print ('The number ',x,' is a multiple of 3 but not 2')
else:
print ('The number ',x,' is a not a multiple of either 2 or 3')
# Get the value of x for next iteration. Enter any non numeric value to
# exit the program.
x = input("Enter a positive number: ")
#Final statement. Bid user a polite good bye
print ('Good Bye')
if __name__ == '__main__':
main()
```