Overview
Change the case of text and build new text from variables with f-strings.
- upper(), lower() and capitalize()
- f"...{value}..." puts values into text
Short Course
Text methods return a new string. An f-string (an f before the
quotes) puts values inside {} straight into the text.
city = "paris"
print(city.upper()) # PARIS
print(city.capitalize()) # Paris
print(f"I love {city}!") # I love paris!
Task
Write name_tag(first, last) that returns the last name in capitals, a
comma, then the first name capitalized, e.g. name_tag("grace", "hopper")
→ HOPPER, Grace.
Test Suites
Pending
Stdout