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
1. Answer the following questions: a. What are the different types of number system? Name them.​
BigorU [14]

Answer:

binary,decimal, hexadecimal and octal number system

5 0
2 years ago
What percent<br> of students in<br> the US are<br> considered<br> ESL<br> students?
mariarad [96]

Answer: 9.5%

Explanation: There were nearly 5 million English language learners in U.S. public schools in fall 2015, according to the most recent available data from the National Center for Education Statistics. This represented 9.5% of U.S. public school enrollees, an increase from 8.1% in 2000

5 0
2 years ago
A computer has a pipeline with four stages. each stage takes the same time to do its work, namely, 1 nsec. how many instructions
prisoha [69]

In figuring, a pipeline, otherwise called an information pipeline, is a lot of information preparing components associated in arrangement

Further explanation:

In figuring, a pipeline, otherwise called an information pipeline, is a lot of information preparing components associated in arrangement, where the yield of one component is the contribution of the following one. The components of a pipeline are frequently executed in parallel or in time-cut style.

Instruction travelling:

999,999,997 guidelines for each second. The pipeline has 3 nsec of straightforward figurings, at that point finishes a guidance in each ensuing nsec.  

3nsec (for first guidance to go down the pipeline).10^9 ns every second. 10^9 – 3 = 999999997 directions.

Instruction per second:

MIPS - Million guidelines for each second  

Million guidelines for each second (MIPS) is a more established, outdated proportion of a PC's speed and power, MIPS measures generally the quantity of machine directions that a PC can execute in one second.

Per second:

Million directions for each second (MIPS) is a more established, old proportion of a PC's speed and power, MIPS measures generally the quantity of machine guidelines that a PC can execute in one second. Be that as it may, various directions require pretty much time than others, and there is no standard strategy for estimating MIPS. Moreover, MIPS alludes just to the CPU speed, while genuine applications are commonly constrained by different elements, for example, I/O speed

Answer Details:

Subject: Computer and technology

Level: College.

Key Words:

Further explanation:

Per second:

Instruction per second:

Instruction travelling:

For further Evaluation:

brainly.com/question/6362387

brainly.com/question/12938965

6 0
3 years ago
Read 2 more answers
Different between embedded computer &amp;<br> Micro controllers
Eduardwww [97]

An embedded computer is a product that uses a microprocessor as a component. Ie a relationship between a car and its engine. A Microcontroller is a microprocessor that is packaged with RAM, program storage and interface circuitry to make it simple to use

6 0
2 years ago
What is the error in the following pseudocode?
kykrilka [37]
I do not know the answers sorryy
4 0
2 years ago
Other questions:
  • Keion works as a freelancer creating websites and designing logos for clients. He recently had a hard drive failure and lost wor
    7·1 answer
  • To decrease the size of text so it will fit into a text box without overflowing, select the
    14·2 answers
  • Where should Nolan go to change the font size of his message before printing it? A.the Paper tab in the Define Styles dialog box
    14·1 answer
  • Which would take more storage space, a layer file showing all the us counties or a layer file showing all the us states?
    8·1 answer
  • If you want a user to actively participate in an online activity, create a web ______________.
    12·2 answers
  • Kris is the project manager for a large software company. Which part of project management describes the overall project in deta
    11·2 answers
  • How to create a network of relevant prospects?
    5·1 answer
  • 100POINTS!!!!!!!!!!!!!!!!!!!I WILL ANSWER ALL OF YOUR QUESTIONS PLEASE LOVES:)))Upload your completed project including the foll
    12·1 answer
  • A small business named Widgets, Inc. has hired you to evaluate their wireless network security practices. As you analyze their f
    13·1 answer
  • Write a while loop that continues to increment uservalue by 5 as long as uservalue is less than 0.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!