Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please write this code in python and start with def business_card(contact_info): Part II: Create a Business Card (20 points) Write a function business.card ), which
please write this code in python and start with
def business_card(contact_info):Part II: Create a Business Card (20 points) Write a function business.card ), which takes a single argument contact.info that contains the contact information for a person. After validating the format of the argument, the function creates a new string that reformats the input in a particular way (described later) CSE 101 - Spring 2018 Lab #13 Page 5 A validly formatted contact.info string is defined by the following components, in the given order: 1. the string ' N' 2. exactly one space 3. a person's name, defined as a single uppercase letter, followed by any combination of uppercase letters, lowercase letters and spaces 4. exactly one space 5. the string ' *P' 6. exactly one space 7. exactly 10 digits 8. exactly one space 9. the string T' 10. exactly one space 11. a person's job title, defined as a single uppercase letter, followed by any combination of uppercase letters, lowercase letters and spaces If the contact-info argument is not validly formatted, the function returns the string 'error' . Otherwise, it returns a new string that contains the contact information reformatted as illustrated in the example below Suppose that the argument is the following validly formatted string: N Milana Howser Ross P 1006344742 T Systems Administrator' The return valid would be this: Part II: Create a Business Card (20 points) Write a function business.card ), which takes a single argument contact.info that contains the contact information for a person. After validating the format of the argument, the function creates a new string that reformats the input in a particular way (described later) CSE 101 - Spring 2018 Lab #13 Page 5 A validly formatted contact.info string is defined by the following components, in the given order: 1. the string ' N' 2. exactly one space 3. a person's name, defined as a single uppercase letter, followed by any combination of uppercase letters, lowercase letters and spaces 4. exactly one space 5. the string ' *P' 6. exactly one space 7. exactly 10 digits 8. exactly one space 9. the string T' 10. exactly one space 11. a person's job title, defined as a single uppercase letter, followed by any combination of uppercase letters, lowercase letters and spaces If the contact-info argument is not validly formatted, the function returns the string 'error' . Otherwise, it returns a new string that contains the contact information reformatted as illustrated in the example below Suppose that the argument is the following validly formatted string: N Milana Howser Ross P 1006344742 T Systems Administrator' The return valid would be this
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