19 lines
525 B
Python
19 lines
525 B
Python
from OddOrEven import OddOrEven
|
|
|
|
OddOrEven(10)
|
|
OddOrEven(69)
|
|
OddOrEven(412948)
|
|
OddOrEven(-555)
|
|
OddOrEven("Hello World!")
|
|
|
|
'''
|
|
I created the second file, OddOrEven.py
|
|
In it, I defined the function OddOrEven, which takes number as an argument
|
|
It then tries to use module 2 to check if its even or odd, and prints if it is or isnt
|
|
|
|
All of this is in a try, and its ready for a TypeError exception, to prevent an error of the input
|
|
is not a divisible number
|
|
|
|
I import the function from the module, and ran it 5 times to test
|
|
|
|
''' |