Witam,
Niedawno zacząłem naukę Pythona. Po ukończeniu tutoriala postanowiłem wziąć się za swój własny projekt bo inaczej ciężko mi cokolwiek zapamiętać. Częścią projektu jest kalkulator ciężaru maksymalnego na podstawie:
Jak obliczyć maksymalny ciężar
Weź kalkulator i postępuj według poniższego schematu.
2 powt. – 1,07
3 powt. – 1,12
4 powt. – 1,15
5 powt. – 1,18
6 powt. – 1,21
7 powt. – 1,24
8 powt. – 1,27
9 powt. – 1,30
10 powt. – 1,33
Dla przykładu: Podniosłem 5 razy ciężar 120 kg, mój maksymalny ciężar to (120 * 1,18 = 141,6 kg). Wystarczy pomnożyć swój wyciskany ciężar przez współczynnik odpowiadający liczbie powtórzeń.
I tak jak przypuszczałem, zaczęły się schody. Byłbym bardzo wdzięczny gdyby ktoś mógł mi napisać co tutaj jest nie tak jak być powinno, że nie chce mi wypisać ciężaru maksymalnego.
Mój kod
"""
Max weight calculator
test_weight = float(raw_input("text test wage:"))
test_powt = float(raw_input("text test powt:"))
max_weight = 0
def max_weight(test_weight, test_powt, max_weight):
if test_powt == 2:
return max_weight == 1.07*test_weight
elif test_powt == 3:
return max_weight == 1.12*test_weight
elif test_powt == 4:
return max_weight == 1.15*test_weight
elif test_weight == 5:
return max_weight == 1.18*test_weight
elif test_powt == 6:
return max_weight == 1.21*test_weight
elif test_powt == 7:
return max_weight == 1.24*test_weight
elif test_powt == 8:
return max_weight == 1.27*test_weight
elif test_powt == 9:
return max_weight == 1.30*test_weight
elif test_powt == 10:
return max_weight == 1.33*test_weight
elif test_powt < 2:
print "You should try again with less weight."
else:
print "You should try again with more weight."
print max_weight
"""
Po uruchomieniu wpisuję ciężar i liczbę powtórzeń a następnie dostaję komunikat:
text test wage:50
text test powt:5
<function max_weight at 0x02C0EAB0>
Process finished with exit code 0