Fill ____
pieces below to have correct values for lower_cased
, stripped
and stripped_lower_case
variables.
original = " Python strings are COOL! "
lower_cased = original._____
stripped = ____.strip()
stripped_lower_cased = original._____._____
Let's verify that the implementation is correct by running the cell below. assert
will raise AssertionError
if the statement is not true.
assert lower_cased == " python strings are cool! "
assert stripped == "Python strings are COOL!"
assert stripped_lower_cased == "python strings are cool!"
Use str
methods to convert ugly
to wanted pretty
.
ugly = " tiTle of MY new Book\n\n"
# Your implementation:
pretty = "TODO"
Let's make sure that it does what we want. assert
raises AssertionError
if the statement is not True
.
print(f"pretty: {pretty}")
assert pretty == "Title Of My New Book"
Create sentence
by using verb
, language
, and punctuation
and any other strings you may need.
verb = "is"
language = "Python"
punctuation = "!"
# Your implementation:
sentence = "TODO"
print(f"sentence: {sentence}")
assert sentence == "Learning Python is fun!"