Question: 8. Write the DEFINITION of a Python function called weird max, which receives two positive int arguments name x and y and a bool

 8. Write the DEFINITION of a Python function called weird max, which receives two positive int arguments name  

8. Write the DEFINITION of a Python function called weird max, which receives two positive int arguments name x and y and a bool argument strong, in that order. When strong is False, the function should return whichever of x and y is greater (either one if there is a tie). When strong is True, the function should return whichever of x and y is greater IF the greater one is at least 10 greater than the other, and otherwise it should return 0. For example, weird max (5, 7, False) should return 7, and weird max (5, 7, True) should return 0. Also, weird max (20, 10, b) should return 20 if b is either True or False. 9. Write code which asks the user to input an integer x and a string y, and then writes the value of x into a file whose name is the value of y.

Step by Step Solution

3.46 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It looks like you want the definition of a Python function named weirdmax that fulfills a specific s... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!