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]
3 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]3 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 Maggie attempted to reconcile her company's monthly sales revenue, she used a TOTALS query to sum the sales from the invoic
shusha [124]

Answer:

The correct answer is "Consistency".

Explanation:

  • It should have been continuous to have the information management service. All information must have been linked, gathered using the same technique as well as measurement but also displayed simultaneously frequencies.
  • Throughout this query, Maggie considers the organization proceeds by a system whereby financial transactions online are not influenced by trade payables or rebates as they are separate accounts that are afterward adjusted for the business model.

Thus, the above is the correct answer.

6 0
3 years ago
A smaller type of memory slot typically used for laptops
yan [13]
Personal Computer Memory Card<span> International Association</span>
3 0
4 years ago
What's the best definition of financial literacy?
8090 [49]

Answer:

defines personal financial literacy as "the ability to use knowledge and skills to manage financial resources effectively for a lifetime of financial well-being.\

Explanation: thats it

5 0
3 years ago
Several key people were involved in programming-language development in the 1970s and 1980s
Viktor [21]

Answer:

Brian Kernighan and Dennis Ritchie created the C programming language, and Bjarne Stroustrup took it to the next level by creating C++ in the 80's.

3 0
3 years ago
Read 2 more answers
An administrator needs to examine ftp commands being passed to a server. what port should the administrator be monitoring?
Hitman42 [59]
Port 21

The server-PI (Server Interpreter) is the process that listens to port 21 on the FTP server. The Server Interpreter has control over server-DTP (Server Data Transfer Process), the method used for data transfer connection. The server-PI must be in a position to respond to standard FTP commands like USER and PASS and several other commands.

 

 



7 0
3 years ago
Other questions:
  • Put the following numbers in order from greatest to least:
    13·1 answer
  • Consider the following relations:
    15·1 answer
  • Can someone please do a java computer science program for me? I’m desperate and I did not have enough time to learn the topic. I
    15·1 answer
  • NAND is logically complete. Use only NAND gates to constructgate-level circuits that compute the
    7·1 answer
  • To insert a new slide, which tab option should you select?
    12·2 answers
  • What is the reasoning you would write an inquiry to a company?
    5·2 answers
  • Using Phyton
    9·1 answer
  • Fill up the blank:- The picture that graphically represents the items you use in Windows is called a/an .......
    5·1 answer
  • Identify similarities and differences of hibiscus leaves <br>​
    14·1 answer
  • State the functions of the parts of the computer​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!