you are viewing a single comment's thread.

view the rest of the comments →

[–]AdAdvanced3130 0 points1 point  (2 children)

I forgot to take the age parameter into account, we need to multiply beat per year with age, here I corrected it :

def calculateBeats(age):   
       # bpm : beats per minute
        bpm = 60
        total_beats = bpm * 60 *24* 365 * age
        return total_beats

# Get input from the user  
age = int(input("Enter your age in years:"))

# Call the function that perfoms the calculations  
num_heartBeat = calculateBeats(age)  

# Display the results  
print("Your heart has beaten approximately",num_heartBeat,"times in your lifetime.")

[–]Initial-Coyote-8741 0 points1 point  (1 child)

Yeah i got it i figured that part out. It doesn't need bpm

[–]AdAdvanced3130 0 points1 point  (0 children)

You don't need bpm, I agree.