Formatting Customer Names Build a function that displays a customer's name and location if applicable Suppose that you are building a Customer Relationship Management (CRM) system, and you want to display a user record in the following format: John Smith (California). However, if you don't have a location in your system, you just want to see "John Smith." Create a format_customer() function that takes two required positional arguments, first_ name and last_name, and one optional keyword argument, location. It should return a string in the required format. Create the customer.py file. Define the format_customer() function. Open a Python shell (Or Jupyter Notebook) and import your format_customer() function. Try running a few examples. The calls should look like this: from customer import format_customer format_customer('John', 'Smith', location='California') and the output should look like this: John Smith (California)

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Formatting Customer Names

Build a function that displays a customer's name and location if applicable
Suppose that you are building a Customer Relationship Management (CRM) system, and you want to display a user record in the following format: John Smith (California). However, if you don't have a location in your system, you just want to see "John Smith." Create a format_customer() function that takes two required positional arguments, first_ name and last_name, and one optional keyword argument, location. It should return a string in the required format.
  1. Create the customer.py file.
  2. Define the format_customer() function.
  3. Open a Python shell (Or Jupyter Notebook) and import your format_customer() function.
  4. Try running a few examples. The calls should look like this:

    from customer import format_customer
    format_customer('John', 'Smith', location='California')

    and the output should look like this:

    John Smith (California)
In [ ]:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage