Ich bin noch relativ am Anfang bei Python.
Da man scheinbar wohl in Lehrbüchern auch einige seltsame Dinge findet, habe ich folgende Bitte:
Kann jemand mal kurz über den Code schauen und mir sagen, ob "Grobe" Schnitzer oder Sinnlosigkeiten drin sind.
Lerne die meiste Zeit mit "lernen durch Tun" und habe mich wie man in meinen anderen Beiträgen sehen kann schon mal ein wenig verrannt.
Danke im Voraus
Code: Alles auswählen
def data_input():
print("Trainingsgewicht:")
weight = float(input())
print("Wiederholungen:")
repetitions = int(input())
return weight, repetitions
def strength_max_calculation(weight, repetitions):
strength_max = weight / (1.0278 - (0.0278 * repetitions))
return strength_max
def strenght_statistics_calculation(strength_max, strength_loop):
strength_statistic = strength_max * (1.0278 - (0.0278 * strength_loop))
return strength_statistic
def strength_data_output():
print()
print("Maximalkraft:")
print()
def strength_statistic_output(strength_loop, strength_statistic):
print("{0:>2}{1:<15}{2:>7.2f}".format(strength_loop, " Wiederholungen:", strength_statistic))
def calculation_method_output():
print()
print("Berechnet mit der 'Brzycki' Formel")
print()
def main():
weight, repetitions = data_input()
strength_max = strength_max_calculation(weight, repetitions)
strength_data_output()
for strength_loop in (1, 5, 10, 12, 15):
strength_statistic = strenght_statistics_calculation(strength_max, strength_loop)
strength_statistic_output(strength_loop, strength_statistic)
calculation_method_output()
if __name__ == '__main__':
main()