Python_Institute
PCEP-30-02 · Question #327
The ABC company is creating a program that allows customers to log the number of miles biked. The program will send messages based on how many miles the customer logs. You create the following…
The correct answer is A. def calc_calories(miles, calories_per_mile): F. def get_name(). See the full explanation below for the reasoning.
Question
The ABC company is creating a program that allows customers to log the number of miles biked. The program will send messages based on how many miles the customer logs. You create the following Python code.
???
name = input('What is your name? ')
return name
??
calories = miles * calories_per_mile
return calories
distance = int(input('How many miles did you bike this week? '))
burn_rate = 50
biker = get_name()
calories_burned = calc_calories(distance, burn_rate)
print(biker + ' , you burned about', calories_burned, 'calories.')
What would you insert instead of ??? and ??? ? (Choose two.)
Options
- Adef calc_calories(miles, calories_per_mile):
- Bdef calc_calories():
- Cdef calc_calories(miles, burn_rate):
- Ddef get_name(biker):
- Edef get_name(name):
- Fdef get_name():
How the community answered
(30 responses)- A80% (24)
- B3% (1)
- D3% (1)
- E13% (4)
Community Discussion
No community discussion yet for this question.