Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python a. Create a file called YOUR_NAME_CityCountry.py i. Write a function called format_city_country_string. 1. Inputs: a. A string for the city name b. A string

image text in transcribed

Python

a. Create a file called "YOUR_NAME_CityCountry.py" i. Write a function called "format_city_country_string". 1. Inputs: a. A string for the city name b. A string for the country name 2. Outputs: a. Formatted string "City, Country" b. For example, "Santiago, Chile" b. Create a file called "YOUR_NAME_CityCountry_test.py" i. Use the unittest module to write multiple test cases to test the "format_city_country_string" function. ii. Test Scenarios to consider: 1. City and Country parameters are provided 2. City is an empty string 3. Country is an empty string 4. City is not a string data type 5. Country is not a string data type iii. These test scenarios should guide your programming logic. Essentially, what should your function do based on each test scenario? 1. Update the function as needed to get these test scenarios to pass. c. Submit both files for this assignment. a. Create a file called "YOUR_NAME_CityCountry.py" i. Write a function called "format_city_country_string". 1. Inputs: a. A string for the city name b. A string for the country name 2. Outputs: a. Formatted string "City, Country" b. For example, "Santiago, Chile" b. Create a file called "YOUR_NAME_CityCountry_test.py" i. Use the unittest module to write multiple test cases to test the "format_city_country_string" function. ii. Test Scenarios to consider: 1. City and Country parameters are provided 2. City is an empty string 3. Country is an empty string 4. City is not a string data type 5. Country is not a string data type iii. These test scenarios should guide your programming logic. Essentially, what should your function do based on each test scenario? 1. Update the function as needed to get these test scenarios to pass. c. Submit both files for this assignment

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

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions