You are tasked with writing an interactive size finder for a T-shirt company. The program should prompt the user for their chest measurement in inches then return the user’s size according to the company’s three size charts: kids, women, and men.
You are tasked with writing an interactive size finder for a T-shirt company. The program should prompt the user for their chest measurement in inches then return the user’s size according to the company’s three size charts: kids, women, and men.
Input prompt: “Chest measurement in inches: ” You can assume the user will enter a number (rather than a string or boolean).
Inform the user of the sizes that are available as follows (see examples 1 and 2):
Your size choices: Kids size: <size> Womens size: <size> Mens size: <size>
...where <size> is the name of the matching size on the appropriate chart (S, M, L etc.) or “not available” if the chart does not have a matching size for the user. If there are no matching sizes for the user (i.e. all three charts are “not available”), print “Sorry, we don't carry your size” instead of the message above. See example 3 below.
Example input / output # 1 (user input is shown in blue) Chest measurement in inches: 32.5
Your size choices:
Kids size: XL
Womens size: M
Mens size: not available
Example input / output # 2 (user input is shown in blue) Chest measurement in inches: 36
Your size choices:
Kids size: not available
Example input / output # 3 (user input is shown in blue) Chest measurement in inches: 22
Sorry, we don’t carry your size
Tip: It should be straightforward to write a program that produces the correct output and passes all tests. However, for full credit, your program must make good use of functions and avoid repeating calculations or comparisons unnecessarily. For example, you should not need to write a separate conditional block for each size chart—consider how you can write one or more functions to handle the logic that is common to all size charts.
Don’t forget to test your functions in test_sizefinder.py!


Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









