Completed Exercise 8-17 Styling Functions
This commit is contained in:
parent
8301da2095
commit
e98942fd6f
@ -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")
|
||||||
|
|||||||
@ -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')
|
||||||
|
|||||||
9
Chapter_08/8-17_styling_functions.py
Normal file
9
Chapter_08/8-17_styling_functions.py
Normal 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
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user