B. Math Utilities: Create a file called math_utilities.py where you will write several useful math functions. The end result will be a module you can use in the future. Note that the first two can be copied and pasted from your in-class assignment Implement these functions in vour module is_divisible(a, b)- returns True if a is divisible by b, otherwise False. is_divisible_either(a, b)- returns True if a is divisible by b or bis divisible by a, otherwise False. is prime(num) - returns True if the number is prime, otherwise False. absolute_equals(a, b) - returns True if Ja is equal to lb, otherwise False is_within(a, b, epsilon)- returns True if the absolute difference between a and b is less than epsilon Write a program called test math_utilties.py that calls each of these with different tests. (You may skip the tests for the first two since we did them in class.) Here are some values to try is_prime: 7-True, 12- False , 13- True, 19 True, 22 False, 35- False absolute_equals: 7,8- False; 7,-7True; -6,6 True; -3,-3-True; 12,12- True; -9,8-False is_within: 5,12,6-False; 5,12,7-False; 5,12,8True; 12,5,7- False; 12,5,8True; 3.333,3.33333,0.001 True; 3.333,3.33333,0.0001False You will upload these two .py files to Canvas as part of your assignment submission: math utilities.py, test math_utilities.py. Shoot a screenshot of your source code for math_utilties.py and paste it here Shoot a screenshot of your source code for test_math_utilities.py and paste it here. Shoot a screenshot of your Python Shell showing the output and paste it here.
B. Math Utilities: Create a file called math_utilities.py where you will write several useful math functions. The end result will be a module you can use in the future. Note that the first two can be copied and pasted from your in-class assignment Implement these functions in vour module is_divisible(a, b)- returns True if a is divisible by b, otherwise False. is_divisible_either(a, b)- returns True if a is divisible by b or bis divisible by a, otherwise False. is prime(num) - returns True if the number is prime, otherwise False. absolute_equals(a, b) - returns True if Ja is equal to lb, otherwise False is_within(a, b, epsilon)- returns True if the absolute difference between a and b is less than epsilon Write a program called test math_utilties.py that calls each of these with different tests. (You may skip the tests for the first two since we did them in class.) Here are some values to try is_prime: 7-True, 12- False , 13- True, 19 True, 22 False, 35- False absolute_equals: 7,8- False; 7,-7True; -6,6 True; -3,-3-True; 12,12- True; -9,8-False is_within: 5,12,6-False; 5,12,7-False; 5,12,8True; 12,5,7- False; 12,5,8True; 3.333,3.33333,0.001 True; 3.333,3.33333,0.0001False You will upload these two .py files to Canvas as part of your assignment submission: math utilities.py, test math_utilities.py. Shoot a screenshot of your source code for math_utilties.py and paste it here Shoot a screenshot of your source code for test_math_utilities.py and paste it here. Shoot a screenshot of your Python Shell showing the output and paste it here.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
Related questions
Question
please solve this in python
////////////////
////////////////
////////////////
////////////////
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 5 images
Knowledge Booster
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.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,