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
When someone refers to "space" on a computer or device, they are usually referring to _____, which allows the user to save a fil
Mama L [17]

Answer:

Memory.

Explanation:

When someone refers to "space" on a computer or device, they are usually referring to memory, which allows the user to save a file for future use, even after the computer has been turned off.

In Computer science, a memory is a term used to describe the available space or an electronic device that is typically used for the storage of data or any computer related information such as images, videos, texts, music, codes and folders. There are basically two (2) main types of memory;

1. Read only memory (ROM).

2. Random access memory (RAM).

3 0
3 years ago
Hey good to mett you
ella [17]

Answer:

You too?

Explanation:

4 0
3 years ago
Which of the following is the component of the processor that directs and coordinates most of the operations in the computer?A.
drek231 [11]

Answer:

C. control unit.

Explanation:

A processor is a miniaturized central processing unit a in digital system that interconnects and controls the activities of other components in the device.

The components of a microprocessor are the bus, registers, cache memory, arithmetic and logical unit and the central or control unit.

The bus is the transportation medium for all activities in the processor. The registers like the accumulator and the B register are memory locations used to hold the operand of an operation.The cache memory holds data meant for immediate use by the processor. Arithmetic and logical unit carries out the various arithmetic and logical operation in the processor, while the control unit is responsible for handling or managing all activities in the processor.

5 0
3 years ago
Which are types of online resources that students can use for help? Check all that apply. simulated labs web-based educational g
Korvikt [17]

Answer:

Simulated Labs

Web-Based Educational Games

Discussion Forums

Explanation:

Did a test with the same question.

3 0
3 years ago
Read 2 more answers
Tamara is writing a program to organize students in a class and needs to use operators to organize student grades, then compare
VMariaS [17]

Answer:   you said "Tamara needs to use

operators to organize the students' grades, then

operators to compare the results."

i think your right

Explanation:

sounds right.

3 0
3 years ago
Other questions:
  • Explain the relationship between society and the technologies of using Earth's resources?
    14·1 answer
  • What is the opening page of a website called?
    9·2 answers
  • Java provides a(n) ____ class, which contains many useful methods for manipulating arrays.
    5·1 answer
  • What does the acronym GIF stand for? Graphics Interface Format Graphics Interchange Format Going Into Files Gathering Informatio
    12·2 answers
  • Research at least two articles on the topic of managerial issues of a networked organization. Write a brief synthesis and summar
    8·1 answer
  • The Fibonacci sequence begins with 0 and then 1 follows. All subsequent values are the sumof the previous two, for example: 0, 1
    11·1 answer
  • The excerpt is a sample works-cited list.
    5·2 answers
  • Question 1 (1 point)
    5·2 answers
  • What are the columns in a Microsoft Access table called?
    15·1 answer
  • Please help i only have 20 minuets
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!