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
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