Question: Using Python 3.6 how would you code the floowing function? Define a function named talk that accepts the following parameters: name - required age -

Using Python 3.6 how would you code the floowing function?

Define a function named "talk" that accepts the following parameters: name - required

age - optional parameter - default value should be 21

occupation - required parameter

In the body of the function do the following: Make sure the name contains no numeric digits (0-9) - If not raise Exception Make sure the age is not a negative value or over 150 - If not raise Exception If the first letter in the name is between 'A' and 'M' then return a string result of 'Group 1' If the first letter in the name is between 'N' and 'Z' then return a string result of 'Group 2'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!