SHARE
TWEET

Untitled

a guest Sep 20th, 2019 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys
  2. import time
  3. gewicht = input("Gewicht in kg: ")
  4. groesse = input("Größe in cm: ")
  5.  
  6. try:
  7.  
  8.     if(int(groesse) < 150):
  9.         print ("")
  10.         time.sleep(4)
  11.         sys.exit(0)
  12.        
  13.     elif(int(gewicht) < 20):
  14.         print ("")
  15.         time.sleep(4)
  16.         sys.exit(0)
  17.    
  18.     elif(int(groesse) > 149):
  19.         print ("")
  20.        
  21.        
  22.         bmi = float(gewicht)/((float(groesse)/100)**2)
  23.    
  24.         if (bmi < 18.5):
  25.             print("BMI von ", round(bmi,1), "-> Starkes Untergewicht")
  26.             time.sleep(4)
  27.        
  28.         elif (bmi >= 18.5 and bmi < 24.9):
  29.             print("BMI von ", round(bmi,1), "-> Normalgewicht")
  30.             time.sleep(4)
  31.    
  32.         elif (bmi >= 25 and bmi < 29.9):
  33.             print("BMI von ", round(bmi,1), "-> Übergewicht")
  34.             time.sleep(4)
  35.    
  36.         elif (bmi > 30):
  37.             print("BMI von ", round(bmi,1), "-> Starkes Übergewicht")
  38.             time.sleep(4)
  39.    
  40.         else:
  41.             print ("Dies ist ein Programmfehler, bitte kontaktieren sie den Entwickler")
  42.             time.sleep(4)
  43.        
  44. except:
  45.     print("")
  46.     print("Falsche Eingabe oder Person ist zu klein")
  47.     time.sleep(4)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top