From 1befd9566ae0692eb08c5a457877db6cb2b3f8c8 Mon Sep 17 00:00:00 2001 From: cheeks <134818917+leftovertoast@users.noreply.github.com> Date: Sun, 9 Mar 2025 23:36:11 +0000 Subject: [PATCH] Completed 11-1 City, Country --- Chapter_11/README.md | 1 + Chapter_11/city_functions.py | 6 ++++++ Chapter_11/test_cities.py | 8 ++++++++ 3 files changed, 15 insertions(+) create mode 100644 Chapter_11/README.md create mode 100644 Chapter_11/city_functions.py create mode 100644 Chapter_11/test_cities.py diff --git a/Chapter_11/README.md b/Chapter_11/README.md new file mode 100644 index 0000000..deed913 --- /dev/null +++ b/Chapter_11/README.md @@ -0,0 +1 @@ +Forgone the naming convention due to conflict with module naming and numbers in the file name. \ No newline at end of file diff --git a/Chapter_11/city_functions.py b/Chapter_11/city_functions.py new file mode 100644 index 0000000..b8bd7fa --- /dev/null +++ b/Chapter_11/city_functions.py @@ -0,0 +1,6 @@ +# Exercise 11-01 City, Country +# Learning Objective: Create a unit test for a function and run it. + +def create_city_string(city, country): + new_string = city.title() + ", " + country.title() + return new_string diff --git a/Chapter_11/test_cities.py b/Chapter_11/test_cities.py new file mode 100644 index 0000000..70b9f3f --- /dev/null +++ b/Chapter_11/test_cities.py @@ -0,0 +1,8 @@ +from city_functions import create_city_string + +def test_city_country(): + output_string = create_city_string("talahasse", "united states") + print(f"{output_string}") + assert output_string == "Talahasse, United States" + +test_city_country() \ No newline at end of file