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
Cerrena [4.2K]
2 years ago
13

Write a function called mul_time that takes a Time_Elapsed object and a number and returns a new Time_Elapsed object that contai

ns the product of the original object and the number. Then use mul_time to write a function that takes a Time_Elapsed object that represents the finishing time in a race, and a number that represents the distance, and returns a Time object that represents the pace (time per mile). The function should return a nicely formatted pace in hour, minutes and second per mile
Computers and Technology
1 answer:
lisov135 [29]2 years ago
7 0

# Write a function called mul_time that takes a Time object and a number and

# returns a new Time object that contains the product of the original Time and

# the number.

# Then use mul_time to write a function that takes a Time object that

# represents the finishing time in a race, and a number that represents the

# distance, and returns a Time object that represents the average pace (time

# per mile).

# Current Status: Complete

class Time(object):

   """ represents the time of day.

   attributes: hour, minute, second"""

time = Time()

time.hour = 3

time.minute = 0

time.second = 0

def time_to_int(time):

   minutes = time.hour * 60 + time.minute

   seconds = minutes * 60 + time.second

   return seconds

def int_to_time(seconds):

   new_time = Time()

   minutes, new_time.second = divmod(seconds, 60)

   time.hour, time.minute = divmod(minutes, 60)

   return time

def mul_time(time, multicand):

   time_int = time_to_int(time) * multicand

   new_time = int_to_time(time_int)

   if new_time.hour > 12:

       new_time.hour = new_time.hour % 12

#    print ("New time is: %.2d:%.2d:%.2d"

#    % (new_time.hour, new_time.minute, new_time.second))

   return new_time

# mul_time(time, 2)

def race_stats(time, distance):

   print ("The finish time was %.2d:%.2d:%.2d"

         % (time.hour, time.minute, time.second))

   print "The distance was %d miles" % (distance)

   average = mul_time(time, (1.0 / distance))

   print ("The average is: %.2d:%.2d:%.2d per mile"

         % (average.hour, average.minute, average.second))

race_stats(time, 3)

You might be interested in
Can you exclude header rows from sort in excel?
Ad libitum [116K]

Answer:

The easiest way to sort excluding first row must be unselecting the first row. keys simultaneously to quickly select the data range from the second row to the end. Then you can sort the data excluding first row.

Explanation:

yes

4 0
2 years ago
Head-mounted displays often use organic light emitting diode,or technology.
nydimaria [60]

Organic light emitting diode,

Technology is a category not a specific thing

7 0
3 years ago
What is the maximum number of communication paths for a team of twenty people?
MAVERICK [17]
Each of the 20 people has 19 other people to communicate to. If you add that all up you get 20*19 paths, but then each path is counted twice (back and forth), so we divide this by 2. 20*19/2 = 190.

The general forumula is n(n-1)/2
6 0
3 years ago
Most students overestimate their skill level and abilities to take open book tests.
leonid [27]
True...the assumption being that the student believes he/she will be able to locate the answer within the text rapidly, but they underestimate the fact that "application" of the content/question is primarily what the instructor is looking for, and will require critical thinking skills to apply the book content to the the question; not just "find the answer". 
3 0
3 years ago
Read 2 more answers
The most common markup language used with web pages is ___________ Question 4 options: A. HTML B. VRML C. Javascript
leonid [27]
Hi there!

The correct answer is A. HTML.

HTML stands for Hypertext Markup Language which is used in nearly all websites and web-based programs. HTML acts as a structure for a website giving you the text, page titles, text-boxes, etc... HTML is also used along with the languages of Javascript, CSS, C++, and others. DO NOT confuse languages like Javascript and the rest with Markup Languages because they are not the same! Javascript, for example, is what is used to make websites more user-friendly and interactive. When you use Brainly, for example, and you hover over someone's name or picture and that box pops up that is Javascript at work and not HTML or any other Markup Language.

-<span>ASIAX </span><span>  </span><span>Frequent Answerer</span>
4 0
3 years ago
Read 2 more answers
Other questions:
  • A. True
    8·2 answers
  • Which statement describes the word "iterative"?
    9·1 answer
  • Learning about public speaking can help improve your ________________.
    15·1 answer
  • Answer the following questions: • What is the source of the user’s request? Can a technical solution solve his problem? Perhaps
    10·1 answer
  • PLEASE HELP!!!!
    6·2 answers
  • WILL MARK CORRECT ANSWER AS BRAINLIEST PLSSSS HELP!
    13·2 answers
  • Simple interest will always pay more interest than compound interest.
    14·1 answer
  • Current flow is the same through all the elements of a series circuit.<br><br> true or false?
    15·1 answer
  • Why do you want to work from our company?​
    9·2 answers
  • Which of the following is NOT a method for applying the SDLC model?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!