Python help, please have all steps and write down comments Implement the functions below following the instruction for each problem.  No template has been provided for these four problems, but I have included lots of hints. Still testing your wings. Be sure to provide an appropriate docstring for each (Note: the docstring for all four of these problems should cover more than one line) and appropriate comments. Write a function diffSequence() that takes a list of numbers (int or float) as a parameter and returns True if every trio in the list (from left to right) have the property that the difference of the first one minus the second one equals the third one. The function returns False if there is any trio in the list that does not have this property. For example, diffSequence([12, 8, 4, 4]) would return True because 12 - 8 = 4 and 8 - 4 = 4, but diffSequence([12, 8, 4, 2]) would return False because 12 - 8 = 4 but 8 - 4 != 2. If the list has fewer than three elements, the function returns False. Do not take the absolute value when computing the difference. The function must return a Boolean it does not print a value. A correct solution to this function must use an indexed loop. That is, one that makes a call to the range() function to generate indices into the list which are used to solve the problem (Review lecture notes 8-1). A solution that does not use an indexed loop will not be accepted. Note in particular that you are not allowed to use the index() or find() methods of the list class. Don’t forget to include the docstring and comments. Submissions that don’t include all will lose points. Copy and paste or screen shot the code and the seven test cases shown below in your submission. How the function should run when running these seven test cases >>> diffSequence([]) False >>> diffSequence([47]) False >>> diffSequence([54,64]) False >>> diffSequence([12,8,4,4]) True >>> diffSequence([12,8,4,2]) False >>> diffSequence([21,13,8,5,3,2,1,1]) True >>> diffSequence([20,15,5,10,5]) False

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Python help, please have all steps and write down comments

Implement the functions below following the instruction for each problem.  No template has been provided for these four problems, but I have included lots of hints. Still testing your wings. Be sure to provide an appropriate docstring for each (Note: the docstring for all four of these problems should cover more than one line) and appropriate comments.

Write a function diffSequence() that takes a list of numbers (int or float) as a parameter and returns True if every trio in the list (from left to right) have the property that the difference of the first one minus the second one equals the third one. The function returns False if there is any trio in the list that does not have this property. For example, diffSequence([12, 8, 4, 4]) would return True because 12 - 8 = 4 and 8 - 4 = 4, but diffSequence([12, 8, 4, 2]) would return False because 12 - 8 = 4 but 8 - 4 != 2. If the list has fewer than three elements, the function returns False. Do not take the absolute value when computing the difference. The function must return a Boolean it does not print a value. A correct solution to this function must use an indexed loop. That is, one that makes a call to the range() function to generate indices into the list which are used to solve the problem (Review lecture notes 8-1). A solution that does not use an indexed loop will not be accepted. Note in particular that you are not allowed to use the index() or find() methods of the list class. Don’t forget to include the docstring and comments. Submissions that don’t include all will lose points. Copy and paste or screen shot the code and the seven test cases shown below in your submission.

How the function should run when running these seven test cases

>>> diffSequence([])

False

>>> diffSequence([47])

False

>>> diffSequence([54,64])

False

>>> diffSequence([12,8,4,4])

True

>>> diffSequence([12,8,4,2])

False

>>> diffSequence([21,13,8,5,3,2,1,1])

True

>>> diffSequence([20,15,5,10,5])

False

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY