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
Gaming related
Blababa [14]

Answer:

yes affects your K/D

Explanation:

winner winner chicken dinner

please mark me please brainliest or mark thanks

5 0
2 years ago
Two ways that a deer depends on plants to survive
Nastasia [14]
Food and oxygen would be the answer
4 0
3 years ago
Read 2 more answers
What is a license that is paid for by number of machines or number of people using the software?.
Kamila [148]

A license that is paid for based on the number of machines or number of people using the software application (program) is called: purchased license.

<h3>What is a software license?</h3>

A software license can be defined as a formal agreement between an end user (customer) and the owner of a software program or software developer, that allows him or her to perform certain tasks with the software application (program).

<h3>The types of software.</h3>

In Computer technology, there are three (3) main types of software programs based on usage rights and these include the following:

  • Shareware
  • Freeware
  • Purchased license

In conclusion, a purchased license is a type of license that is typically being paid for based on the number of machines or number of people that are using the software application (program).

Read more on software here: brainly.com/question/25703767

5 0
2 years ago
What is a current Gdp and what is a real Gdp?
SpyIntel [72]
Do u mean GPD? OORRR
5 0
3 years ago
Read 2 more answers
Once you follow someone on Twitter, your tweets will automatically show up on their newsfeed. True False
Mrrafil [7]

true

-------------------------------------------------------

8 0
2 years ago
Other questions:
  • What type of computer would integrate the system unit with the display and keyboard?
    7·1 answer
  • Take some time to do some research about small businesses in your area. Select one and using HTML design a simple site that educ
    11·1 answer
  • Technological uncertainty:
    15·1 answer
  • 16 to 19 year old drivers are how many more times likely to crash? 1.7,2.7,0.7 ,3.7
    12·2 answers
  • Select one or more of the following: Which of these events will cause signal(s) to be generated by the kernel (the operating sys
    6·1 answer
  • A(n) _______ gate provides an output of 1 if either or both inputs are 1.
    14·2 answers
  • QUESTION 4 of 10: What term refers to the basic characteristics of a population segment, such as gender, age, and income?
    12·2 answers
  • 2. Select the things you can do when working with rows in columns in a spreadsheet:
    5·1 answer
  • If you created a variable called name, what data type would that value be? Group of answer choices a float a string a Boolean an
    5·2 answers
  • Your first submission for the CIS 210 Course Project should include the following functionality: - Requests the user to input hi
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!