Question
IN PYTHON Create a directory within PyCharm for this assignment, then create python files called functions.py and a2_q1.py In the functions.py file, write a function
IN PYTHON
Create a directory within PyCharm for this assignment, then create python files called functions.py and a2_q1.py In the functions.py file, write a function called all_odd_or_even to meet the following specifications: accept any number of arguments return True if it receives at least one argument, AND all the arguments are integers, AND the arguments are either all odd OR all even return False in all other situations (including the situation in which it is called with no arguments or invalid arguments) Import this function, and this function only, into your main program in a2_q1.py. In this main program, you are going to ask the user to input all of the arguments into this function by doing the following: Begin by introducing what you are doing to the user and ask if they would like to participate in this activity. Only proceed if the user answers yes. Ask the user for an integer to add to this function. If an integer is provided: Save the integer so you can send it to the function later Ask if they would like to add another integer. Only proceed if they say yes. If an integer is not provided: Quit, and give the user an error message. When the user is done, call the function on the integers provided by the user.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started