[Python] Expression for calories burned during workout [closed]

Discussão em 'Python' iniciado por Stack, Julho 4, 2025.

  1. Stack

    Stack Membro Participativo

    Expression for calories burned during workout I have watched videos and I have the same code, but I am getting an error with the division. This is week one.

    This is the error i keep getting:

    Traceback (most recent call last):
    File "/home/runner/local/submission/main.py", line 9, in <module>
    calories = ((age_years * 0.2757), + (weight_pounds * 0.03295) + (heartrate_bpm * 1.0781) - 75.4991) * time / 8.368
    TypeError: unsupported operand type(s) for /: 'tuple' and 'float'


    inputs from the system: 34 132 148 90

    ''' Calories = ((Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991) x Time / 8.368 '''


    calories = 0

    age_years = int(input())
    weight_pounds = int(input())
    heartrate_bpm = int(input())
    time = int(input())

    calories = ((age_years * 0.2757), + (weight_pounds * 0.03295) + (heartrate_bpm * 1.0781) - 75.4991) * time / 8.368


    How do I get rid of the error and still divide?

    Continue reading...

Compartilhe esta Página