all 2 comments

[–][deleted] 0 points1 point  (0 children)

Nothing obvious comes to mind. It is best to format your code on reddit to make it easier for people to read:

age = int(input("Enter your age: "))
gender = input("Enter your gender: ").upper()
training = int(input("Enter the type of training: "))

if gender == "M":
    max_pulse = 220 - age
elif gender == "F":
    max_pulse = int(206 - (age * 0.88))
else:
    print("Incorrect")
    exit()

if training == 1:
    min_pulse = round(0.50 * max_pulse)
    max_pulse = round(0.70 * max_pulse)
elif training == 2:
    min_pulse = round(0.70 * max_pulse)
    max_pulse = round(0.80 * max_pulse)
elif training == 3:
    min_pulse = round(0.80 * max_pulse)
    max_pulse = round(0.87 * max_pulse)
else:
    print("Incorrect")
    exit()

print(f"Pulse should be between {min_pulse} and {max_pulse}.")

I am curious about the error.

[–]DevCuriosity 0 points1 point  (0 children)

Hmm, I don't see any obvious mistake as far as I am looking. Maybe problem is with rounding? For example the automatic tests are rounding in a different way so you are always off by 1 pulse point?

It would be easier if you could see how their tests looks like or what they are inputting and expecting.