Completed Exercise 8-17 Styling Functions

This commit is contained in:
cheeks 2025-02-27 00:30:21 +00:00
parent 8301da2095
commit e98942fd6f
3 changed files with 13 additions and 0 deletions

View File

@ -2,6 +2,8 @@
# Learning Objective: Write a function with 2 arguments. # Learning Objective: Write a function with 2 arguments.
def make_shirt(size='S', message='your text here'): def make_shirt(size='S', message='your text here'):
"""Takes two string arguments of 'Size' and 'Message' and outputs the
resulting string"""
print(f"\tNew shirt to be made:\n\tSIZE: {size}\n\tMESSAGE: {message}") print(f"\tNew shirt to be made:\n\tSIZE: {size}\n\tMESSAGE: {message}")
make_shirt("L", "Hello Python World") make_shirt("L", "Hello Python World")

View File

@ -2,6 +2,8 @@
# Learning Objective: Write a function that has a default value. Call it three times. # Learning Objective: Write a function that has a default value. Call it three times.
def describe_city(city, country='United States'): def describe_city(city, country='United States'):
"""Takes a city and a country (defaults to US) and returns it as a
string"""
print(f'{city.title()} is in {country.title()}') print(f'{city.title()} is in {country.title()}')
describe_city('Chicago') describe_city('Chicago')

View File

@ -0,0 +1,9 @@
# Exercise 8-17 Styling Functions
# Learning Objective: Ensure 3 of the programs written for Chapter 8 follow
# best practices and styling guidelines.
# Confirmed Exercises:
# 8-03 T-Shirt
# 8-05 Cities
# 8-13 User Profile