if w == -1: print('wartosc nieprawidlowa') else: break else: w = float(weight) break print(w) height = input("Podaj wzrost w m: ") try: float(height) except ValueError as e: h = fix_units(height, 'm') if h == -1: print('wartosc nieprawidlowa') else: h = float(height) print(h) result_bmi = bmi.calculate_bmi(w, h) state = bmi.get_state(result_bmi) print(state) filename = state.lower() + '.txt' with open(filename) as fopen: tip = fopen.read() print(tip)
import bmi bmi.get_state(105)