
PYTHON
The data is given as a list of integer with comma separated in the order
<hours> ,<weight>
(i.e. [<hours> ,<weight>,...., <hours> ,<weight>] ). This data represents the weight of the load at the given time.
For example:
l = [0, 12, 5, 60, 10, 80, 13, 35]
where 0 (l[0]), 5 (l[2]), 10 ([l[4]), 13 (l[6]) are <hours> (time values)
and 12 (l[1]), 60 (l[3]), 80 (l[5]), 35 (l[7]) are <weight> (weight load)
The data must follow specific format:
1. The time values <hours> must be defined incrementally
2. No duplicate time values
Write a function in python that checks the data to determine if the data follows the required format. If the data follows the requirements above, return True. Otherwise, return False.
Example of accepted data -> return True
[0, 12, 5, 60, 10, 80, 13, 35]
[0, 200, 15, 120, 25, 977, 100, 3083]
Example of unacceptable data -> must return False
[1, 10, 25, 50, 75, 55, 4, 100, 5, 150]: time values are not defined incrementally!
[0, 12, 5, 60, 5, 60, 13, 35]: duplicate time values!
[0, 200, 15, 120, 25, 977, 15, 3083, 15, 3089]: duplicate time values!

Step by stepSolved in 4 steps with 2 images

- In python pleasearrow_forwardThis is for Python version 3.8.5 and please include pseudocode. nums = [8, 15, 6, 17, 33, 20, 14, 9, 12]Write Python code that: uses a function to print the size of the list named nums uses a function to print the largest number in nums prints the element 14 by using its index makes a slice named subnums containing only 33, 20, and 14arrow_forwardm = int(temp[1]) IndexError: list index out of range line 3, in <module> m = int(temp[10])IndexError: list index out of range when i ran this test case input: 3 jun3 Jin1 Li2 Kitty2 Josh3 Bob1 Dave2 Jose1 David3 Rob3 Anne3 Ann2 Kevin2 Lara1 ALI3 Xin expected output: Li Dave David ALI Kitty Josh Kevin Lara jun Bob Anne Ann Xinarrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





