Add script.py
This commit is contained in:
19
script.py
Normal file
19
script.py
Normal 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
|
||||
|
||||
'''
|
||||
Reference in New Issue
Block a user