Return strings from a function - Method(s)


i am looking for the correct method/theory to solve the following task:

the user needs to input size [‘S’, ‘M’, ‘L’, ‘XL’] and input free text (shirt print)

if size is one from the list print (‘message 1’)

if size is NOT one from the list print (‘message 2’)

important is that even if the user first chooses a size that isn’t available, they should still be asked which text they wish on their shirt

how could i go around solving this?


You have pretty good description what should be done:

# define allowed sizes
# ask from user a size
# ask from user text to be printed on t-shirt
# if size from user is in defined sizes:
#    print something
# else:
#    print something else

thanks a lot!