Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bani=float(input("Cati bani aveti in portofel?"))
- if bani <100:
- print ("Stati acasa!")
- else:
- nume=input("Cum te cheama?")
- greutatea=float(input("Introduceti greutatea"))
- inaltimea=float(input("Introduceti inaltimea in metri"))
- bmi=greutatea/(inaltimea*inaltimea)
- tipPersoana=None
- if bmi<18.5:
- tipPersoana="slab"
- elif bmi >=18.5 and bmi<25:
- tipPersoana="normal"
- elif bmi>=25 and bmi<30:
- tipPersoana="supraponderal"
- elif bmi >=30:
- tipPersoana="obez"
- print(tipPersoana)
- paste=("paste", 0.5, 4, 23.7, 52.88, 3.7)
- mere=("mere", 1, 3, 0.7, 13.81, 0.17)
- carnePorc=("carne porc", 1, 20, 20.4, 0, 6.3)
- lapte=("lapte", 1, 3.5, 33, 48, 35)
- oua=("oua",0.1, 0, 7, 3.0, 11)
- listaProduse=[paste, mere, carnePorc, lapte,oua]
- if tipPersoana == "supraponderal":
- for produs in listaProduse:
- if produs [5] >=10:
- print("Nu cumpara:"+produs[0]+"!")
- else:
- bani=bani-produs[2]
- if bani<=0:
- break
- elif tipPersoana=="obez":
- for produs in listaProduse:
- if produs[5]>=10 or produs[4]>= 5:
- print("Nu cumpara:"+produs[0]+"!")
- else:
- bani=bani-produs[2]
- if bani<=0:
- break
- else:
- print ("Poti cumpara orice!")
- print("Mai ai" + str(bani) +"!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement