1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Rzqust [24]
2 years ago
7

Write a function named partfthat takes inas parameterstwo parallel lists: a list of times (in increasing order), and a list of d

istance traveled by that point in time. The function should return a new list giving the average velocity between consecutive time measurements. The new list should have a length of one less than the original lists.
Computers and Technology
1 answer:
mario62 [17]2 years ago
4 0

The program calculates the velocity between points in a list is written below. The program is written in python 3 thus ;

t = input("Enter time values : ")

<em>#Enter</em><em> </em><em>the</em><em> </em><em>time</em><em> </em><em>values</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>data</em>

p = input("Enter distance values : ")

<em>#Enter</em><em> </em><em>the</em><em> </em><em>distance</em><em> </em><em>values</em>

dist = [float(x) for x in p.split()]

time = [float(x) for x in t.split()]

<em>#pyt</em><em> </em><em>then</em><em> </em><em>values</em><em> </em><em>in</em><em> </em><em>a</em><em> </em><em>list</em><em> </em>

def partfthat(dist, time):

<em>#initialize</em><em> </em><em>function</em><em> </em><em>that</em><em> </em><em>takes</em><em> </em><em>in</em><em> </em><em>two</em><em> </em><em>parameters</em><em> </em>

vel = []

<em>#empty</em><em> </em><em>list</em><em> </em><em>to</em><em> </em><em>hold</em><em> </em><em>the</em><em> </em><em>calculated</em><em> </em><em>velocity</em><em> </em><em>values</em><em> </em>

i = 0

<em>#indexer</em><em> </em>

while i <= len(dist)-2:

<em>#while</em><em> </em><em>loop</em><em> </em><em>to</em><em> </em><em>iterate</em><em> </em>

v = (dist[i+1] - dist[i]) / (time[i+1] -time[i])

<em>#</em><em>Use</em><em> </em><em>the</em><em> </em><em>velocity</em><em> </em><em>formula</em><em> </em>

vel.append(v)

<em>#append</em><em> </em><em>values</em><em> </em><em>to</em><em> </em><em>the</em><em> </em><em>empty list</em><em> </em><em>created</em><em> </em>

i+=1

return vel

print(avg_vel(dist, time))

<em>A</em><em> </em><em>sample</em><em> </em><em>run</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>program</em><em> </em><em>is</em><em> </em><em>attached</em><em>.</em><em> </em>

Learn more : brainly.com/question/25681441

You might be interested in
Name the different views in word​
svlad2 [7]

Answer:

Print Layout, Full-Screen Reading, Web Layout, Outline, and Draft are 5 different views in Word.

Hope this helps!

4 0
2 years ago
When recording data on a multiple-disk storage system, should we fill a complete disk surface before starting on another surface
Cerrena [4.2K]

The user needs to complete the entire disk surface first before starting another surface.

Explanation:

When you are using a multiple disk storage system to write the data the disk automatically writes the disk based on the algorithm for better efficiency and availability of the disk space.

hence when you are recording a data on a multiple disk storage system, it is recommended to fill the complete disk surface initially before you start the another surface to record the data.

4 0
3 years ago
Help Me Please. I'm Begging you
Luba_88 [7]

Answer:

d and b can't see the last ones answer so im guessing this is what you needed.

Explanation:

8 0
2 years ago
Which of these conclusions supports the fact that Eclipse is categorized as an IDE?
Drupady [299]

Answer:

The user must specify the programming language he or she wants to use.

Explanation:

6 0
2 years ago
A victimless crime is committed when
Ksju [112]
Someone downloads a pirated song or video a copyrighted image is used without permission and a person downloads and uses pirated software.
3 0
1 year ago
Other questions:
  • what properties are associated with all Microsoft Office files and include author, title, and subject
    5·1 answer
  • What economic measure is at the highest level since the Great Depression?
    12·1 answer
  • Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards
    7·1 answer
  • The file extensions .webm, .m4v, and .ogv are used for:
    15·1 answer
  • The function below takes a string argument sentence. Complete the function to return the second word of the sentence. You can as
    5·1 answer
  • Implement RandMultipByVal function, which gets one integervariable as its argument
    12·1 answer
  • Advantages and disadvantages of technology
    13·1 answer
  • “identify the skill in the following scenario” :
    6·2 answers
  • What is the point of brainy when other people have to answer your questions but not the cumputer
    9·1 answer
  • Write a java code to print Multiplication Table Till 20
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!