Please use python and run in IDLE Question 1 Write functions that do the following: i) A function...

80.2K

Verified Solution

Question

Programming

Please use python and run in IDLE

Question 1

Write functions that do the following:

i) A function that takes 2 arguments and adds them. The resultreturned is the sum of the parameters.

ii) A function that takes 2 arguments and returns thedifference,

iii) A function that calls both functions in i) and ii) andprints the product of the values returned by both.

Question 2

Write functions:

i) One that prompts a user for 2 numbers.

ii) Adds the two numbers if they are even

iii) Multiplies the two numbers if they are odd

iv) Displays the appropriate output to the user

You are writing 4 functions and calling them to testfunctionality.

Answer & Explanation Solved by verified expert
3.6 Ratings (306 Votes)
PYTHON CODE1def addnumabfunction for additionsumabreturn sum return valuedef diffabfunction for differencediffabreturn diffdef callab function for Product of    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students