Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5.) Write a function called pants_sizethat has a single parameter (the value will be an integer) representing a person's waist size in inches. The function
5.) Write a function called pants_sizethat has a single parameter (the value will be an integer) representing a person's waist size in inches. The function returns a string. The string returned will be either "small", "medium", or "large" depending on the parameter value. Waist measurements that are 34 inches or larger should return large. Measurements that are 30 inches or larger, but not large enough to be in the large category, should return medium Anything smaller should return small Here are some examples of calling the function with different arguments. (The code executed is in blue, the value returned by the function is in green) pants_size (38) pants_size (34) pants_size (33) pants_size (29) pants_size (-20) pants_size (2000) -arge -large -->'medium -->small small -> -arge
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started