Add script.py

This commit is contained in:
2025-04-07 14:34:52 -07:00
commit 08501e4079

19
script.py Normal file
View File

@@ -0,0 +1,19 @@
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
'''