190k views
2 votes
1b)

Which of the following would be a good name for the function that takes the length of a race and returns the time needed to complete
#
A.
B.
C.
D.
Choice
Cost(time)
Time(race)
Length(time)
Time(length)

1 Answer

5 votes

Final answer:

A good name for the function that takes the length of a race and returns the time needed to complete is Time(race).


Step-by-step explanation:

A good name for the function that takes the length of a race and returns the time needed to complete could be Time(race). This name accurately describes the purpose of the function, as it indicates that it will calculate the time based on the race length. The function could look like:

def Time(race): # Calculate time based on race length return time

By using this function name, it becomes clear what the function does and what input it expects.


Learn more about naming functions for race time calculation

User Rahul Hirve
by
7.8k points

No related questions found