Hi all,
I am new to Python and was wondering if anyone can simply help me with the following. I am tasked with created a basic drink ordering program and am stuck on the following:
Getting size: Create a function called "get_size" that asks the user what size beverage the user wants (S,M,L) and assigns it to a variable called "size_input". If the user enters an invalid value, , assume the size is a Small. Based on their input, return a variable called “size” from the function.
I am stuck on the second and third part - how do I create a variable from the users input? is it simply size_input = get_size?
Furthermore, how do I create a "size" variable from an existing variable? It seems redundant.
Apologies in advance if I am not wording/asking this correctly, this is a whole new world for me.
THanks!
MD
I am new to Python and was wondering if anyone can simply help me with the following. I am tasked with created a basic drink ordering program and am stuck on the following:
Getting size: Create a function called "get_size" that asks the user what size beverage the user wants (S,M,L) and assigns it to a variable called "size_input". If the user enters an invalid value, , assume the size is a Small. Based on their input, return a variable called “size” from the function.
I am stuck on the second and third part - how do I create a variable from the users input? is it simply size_input = get_size?
Furthermore, how do I create a "size" variable from an existing variable? It seems redundant.
Apologies in advance if I am not wording/asking this correctly, this is a whole new world for me.
THanks!
MD