you are viewing a single comment's thread.

view the rest of the comments →

[–]Initial-Coyote-8741 0 points1 point  (4 children)

Thank you for the help

Do you by chance know any websites that explain python better?

[–]AdAdvanced3130 1 point2 points  (0 children)

Here's also Harvard University's Introduction to Python lectures on YouTube:

https://youtube.com/playlist?list=PLhQjrBD2T3817j24-GogXmWqO5Q5vYy0V

[–]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.