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
what will happen to the contents of the destination ell if you copy the contents of the source cell into the destination cell
DochEvi [55]

Answer:

It's content will be replaced with a content from the source cell.

7 0
3 years ago
Choose the term to complete the sentence.
netineya [11]

Answer:

raster

Explanation:

-> A <u>raster</u> image consists of a grid of colored pixels.

To choose our answer we can look at the definition for each of the options:

[✘] wireframe - "a skeletal three-dimensional model in which only lines and vertices are represented"

[✘] vector - "denoting a type of graphical representation using straight lines to construct the outlines of objects"

[✔] raster - "a rectangular pattern of parallel scanning lines followed by the electron beam on a television screen or computer monitor'

[✘] rendering - "the processing of an outline image using color and shading to make it appear solid and three-dimensional"

<em>(All definitions are quoted from Oxford Languages)</em>

-> Based on these definitions, raster makes the most sense

Have a nice day!

     I hope this is what you are looking for, but if not - comment! I will edit and update my answer accordingly. (ノ^∇^)

- Heather

4 0
2 years ago
List three social implications of the wider range of piracy​
liraira [26]

Answer:

Street prices are affected by the extent of illegal commercial copying. The availability of inexpensive, high-quality illegal copies reduces the demand for legal copies to the extent that some users buy illegal copies instead of legal ones.

7 0
3 years ago
List four tasks that humans perform frequently, but which may be difficult for a computerized agent to accomplish. Describe the
denis23 [38]

Answer:

im sorry for that

Explanation:

5 0
2 years ago
Does anyone play genshin impact here?
Reika [66]
Answer


NO sorry
Have a great day
6 0
3 years ago
Read 2 more answers
Other questions:
  • Which type of architecture places a firewall in front of the VPN to protect it from Internet-based attacks as well as behind a f
    6·1 answer
  • Describe three general methods for passing parameters to the operating system.
    6·1 answer
  • Which tab provide text formatting features
    11·1 answer
  • Gemima wants to show the amount of vitamin C a fruit salad contains in the blue cell of the table below. To do this, she needs t
    9·2 answers
  • Which is not an element of photography? a Cropping b Height c Directional Lighting d Framing
    11·1 answer
  • The simplest method to copy information is to first select the information you want to copy, and then use the Copy button and th
    11·1 answer
  • Why won't Brainly let me send a link? This is just du*mb! I want to send good articles explaining a content, and this site just
    5·1 answer
  • In one to two sentences, describe how you would add a new slide to your presentation.
    11·2 answers
  • I need help <br> with a question<br> what can i write for ex when he mad
    13·2 answers
  • WHICH PROGRAMMING LANGUAGES ARE THE BEST AND COMPATIBLE FOR 3D PRINTERS?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!