Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions

Question

=+What is the lowest price? Explain.

Answered: 1 week ago

Question

LO6.1 Discuss price elasticity of demand and how it is calculated.

Answered: 1 week ago