I would want this code to have an ui or an interface i can use. My question is what to learn to make this into something that a person can interact with. Also is this a good code for a beginner.
#_______________________________________________________________________________inputs from keyboards
foodtype= str(input("What type of Food did you eat choose from the following \n Burger \n Pizzaslice \n Popcorn \n Enter food here= "))
pecies_consummed = int(input("how many grams of the " +foodtype +" did you consume? \n Enter grams here= "))
#______________________________________________________________________________________values for stuff
#calories per gram
Burger= 3
Pizzaslice= 3
Popcorn= 4
kilometre= 62
#_______________________________________________________________________________________________________functions
def burger_calories(pecies_consummed):
calories_consumed= pecies_consummed*Burger
print(calories_consumed)
def pizza_calories(pecies_consummed):
calories_consumed= pecies_consummed*Pizzaslice
print(calories_consumed)
def popcorn_calories(pecies_consummed):
calories_consumed= pecies_consummed*Popcorn
print(calories_consumed)
def calories_burned_burger(pecies_consummed):
calories_consumed= pecies_consummed*Burger
burn_calori= calories_consumed//kilometre
print("you need to walk this many km to burn it off")
print(burn_calori)
def calories_burned_pizzaslice(pecies_consummed):
calories_consumed= pecies_consummed*Pizzaslice
burn_calori= calories_consumed//kilometre
print("you need to walk this many km to burn it off")
print(burn_calori)
def calories_burned_popcorn(pecies_consummed):
calories_consumed= pecies_consummed*Popcorn
burn_calori= calories_consumed//kilometre
print("you need to walk this many km to burn it off")
print(burn_calori)
#_________________________________________________________________________________________________________________________calories calculted
if foodtype == "Burger":
print("This many calories were consumed while eating burgers")
burger_calories(pecies_consummed)
elif foodtype == "Pizzaslice":
print("This many calories you consumed while eating pizzaslices")
pizza_calories(pecies_consummed)
elif foodtype == "Popcorn":
print("This many calories you consumed with your popcorn")
popcorn_calories(pecies_consummed)
else:
print("succesfully failed at eating")
#_________________________________________________________________________________________________________________________How much will take to burn it off
if foodtype == "Burger":
calories_burned_burger(pecies_consummed)
elif foodtype == "Pizzaslice":
calories_burned_pizzaslice(pecies_consummed)
elif foodtype == "Popcorn":
calories_burned_popcorn(pecies_consummed)
else:
print("and at walking aswell daam")
I would want this code to have an ui or an interface i can use. My question is what to learn to make this into something that a person can interact with. Also is this a good code for a beginner.