Well, that's my first "program" after couple days of working with Python and programming itself. That may be stupid since everything there is so basic but I wanted to ask if there are any spaces to improve it. Idea was to give the user proper dosage of 4 supplements regarding if this is training day or not.
Is there any way to achieve it faster, more simple, better? Appreciate all feedback!
Edit
Thanks for all your replies! I will go through all of them and learn from them what i can, still confused in programming world.
dayon = {"BCAA" : "10g",
"White" : "50g",
"Glutamine" : "20g",
"Vitamins" : 10}
dayof= {"BCAA" : "5g",
"White" : "25g",
"Glutamine" : "10g",
"Vitamins" : 5}
username = input("What is your name?\n")
trening = input("Are you going to the gym today?\n")
def dosage():
if trening == "yes":
return (username + ", you have to take: " +
"\nBCAA in dosage of: " + str(dayon["BCAA"]) +
"\nWhite in dosage of: " +str(dayon["White"]) +
"\nGlutamine in dosage of: " + str(dayon["Glutamine"]) +
"\nVitamins in number of: " +str(dayon["Vitamins"]))
elif trening == "no":
return (username + ", you have to take: " +
"\nBCAA in dosage of: " + str(dayof["BCAA"]) +
"\nWhite in dosage of: " + str(dayof["White"]) +
"\nGlutamine in dosage of: " + str(dayof["Glutamine"]) +
"\nVitamins in number of: " + str(dayof["Vitamins"]))
else:
print ("Please answer yes or no")
print (dosage())