Calculate proper dosage of supplements to take Well, that's my first &quot;program&quot; 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 = {&quot;BCAA&quot; : &quot;10g&quot;,
  &quot;White&quot; : &quot;50g&quot;,
  &quot;Glutamine&quot; : &quot;20g&quot;,
  &quot;Vitamins&quot; : 10}

dayof= {&quot;BCAA&quot; : &quot;5g&quot;,
    &quot;White&quot; : &quot;25g&quot;,
    &quot;Glutamine&quot; : &quot;10g&quot;,
    &quot;Vitamins&quot; : 5}

username = input(&quot;What is your name?\n&quot;)
trening = input(&quot;Are you going to the gym today?\n&quot;)

def dosage():
    if trening == &quot;yes&quot;:
       return (username + &quot;, you have to take: &quot; +
        &quot;\nBCAA in dosage of: &quot; + str(dayon[&quot;BCAA&quot;]) +
        &quot;\nWhite in dosage of: &quot; +str(dayon[&quot;White&quot;]) +
        &quot;\nGlutamine in dosage of: &quot; + str(dayon[&quot;Glutamine&quot;]) +
        &quot;\nVitamins in number of: &quot; +str(dayon[&quot;Vitamins&quot;]))
    elif trening == &quot;no&quot;:
        return (username + &quot;, you have to take: &quot; +
        &quot;\nBCAA in dosage of: &quot; + str(dayof[&quot;BCAA&quot;]) +
        &quot;\nWhite in dosage of: &quot; + str(dayof[&quot;White&quot;]) +
        &quot;\nGlutamine in dosage of: &quot; + str(dayof[&quot;Glutamine&quot;]) +
        &quot;\nVitamins in number of: &quot; + str(dayof[&quot;Vitamins&quot;]))
    else:
        print (&quot;Please answer yes or no&quot;)


print (dosage())
Here is the list of things I would improve:


for handling the proper answer on the "Are you going to the gym today?", I would start the while loop until "Yes" or "No" is entered
put the execution logic under if __name__ == '__main__':
define a message template with appropriate placeholders - format it with "day on" or "day off" objects and the entered username
define constants in upper case as per PEP8
let the "dosage" function return the dosage object - print the message outside of the function - for the better logic separation 
add meaningful comments and docstrings


The code with all the suggested changes applied:

DAY_ON = {
    "BCAA": "10g",
    "White": "50g",
    "Glutamine": "20g",
    "Vitamins": 10
}

DAY_OFF = {
    "BCAA": "5g",
    "White": "25g",
    "Glutamine": "10g",
    "Vitamins": 5
}

MESSAGE_TEMPLATE = """
{username}, you have to take:
    BCAA in dosage of: {obj[BCAA]}
    White in dosage of: {obj[White]}
    Glutamine in dosage of: {obj[Glutamine]}
    Vitamins in number of: {obj[Vitamins]}
"""


def get_dosage(is_training_day):
    """Returns appropriate dosage depending on whether it is a training day or not"""
    return DAY_ON if is_training_day else DAY_OFF


if __name__ == '__main__':
    username = input("What is your name?\n")

    while True:
        choice = input("Are you going to the gym today?\n")

        if choice in ('Yes', 'No'):
            break
        else:
            print("You can only enter 'Yes' or 'No'.")

    dosage = get_dosage(is_training_day=choice == 'Yes')
    print(MESSAGE_TEMPLATE.format(username=username, obj=dosage))


Demo:

$ python3 test.py 
What is your name?
Chubaka
Are you going to the gym today?
What?
You can only enter 'Yes' or 'No'.
Are you going to the gym today?
No

Chubaka, you have to take:
    BCAA in dosage of: 5g
    White in dosage of: 25g
    Glutamine in dosage of: 10g
    Vitamins in number of: 5




If you are using Python3.6+, you can also use f-strings for string formatting:

dosage = get_dosage(is_training_day=choice == 'Yes')
print(f"""
{username}, you have to take:
    BCAA in dosage of: {dosage['BCAA']}
    White in dosage of: {dosage['White']}
    Glutamine in dosage of: {dosage['Glutamine']}
    Vitamins in number of: {dosage['Vitamins']}
""")