Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions