Any fan of the late author Douglas Adams (The Hitchhiker's Guide to the Galaxy) knows that 42 is a truly great number. Use the function design recipe to develop a function named great_42. This function takes two integer values, a and b. It returns True if either value is 42, or if their sum or the absolute value of their difference is 42. Before you write any code, build a truth table. The table header is: a b Returned value Your function definition must have type annotations and a complete docstring. Use the table to help you create example function calls and design the function body. Use the Python shell to test great_42. Hint 1: the built-in function abs(x) computes the absolute value of x. Hint 2: Boolean operators (and, or, and not) aren't required, but the shortest solution has no if statement and instead has a single statement: return expression (expression will contain Boolean operators).

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter5: Working With Multiple Worksheets And Workbooks
Section: Chapter Questions
Problem 4AYK
icon
Related questions
Question

please complete the exercise. thank youu

Any fan of the late author Douglas Adams (The Hitchhiker's Guide to the Galaxy) knows that 42
is a truly great number.
Use the function design recipe to develop a function named great_42. This function takes two
integer values, a and b. It returns True if either value is 42, or if their sum or the absolute value
of their difference is 42.
Before you write any code, build a truth table. The table header is:
a
b
Returned value
Your function definition must have type annotations and a complete docstring. Use the table to
help you create example function calls and design the function body. Use the Python shell to test
great_42.
Hint 1: the built-in function abs(x) computes the absolute value of x.
Hint 2: Boolean operators (and, or, and not) aren't required, but the shortest solution has no if
statement and instead has a single statement:
return expression
(expression will contain Boolean operators).
Transcribed Image Text:Any fan of the late author Douglas Adams (The Hitchhiker's Guide to the Galaxy) knows that 42 is a truly great number. Use the function design recipe to develop a function named great_42. This function takes two integer values, a and b. It returns True if either value is 42, or if their sum or the absolute value of their difference is 42. Before you write any code, build a truth table. The table header is: a b Returned value Your function definition must have type annotations and a complete docstring. Use the table to help you create example function calls and design the function body. Use the Python shell to test great_42. Hint 1: the built-in function abs(x) computes the absolute value of x. Hint 2: Boolean operators (and, or, and not) aren't required, but the shortest solution has no if statement and instead has a single statement: return expression (expression will contain Boolean operators).
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage