PRACTICE

Working with Strings

Lesson notes

Your task

Set text to " Python ". Print it stripped of spaces and converted to uppercase.

Expected output
PYTHON
Loading…

OUTPUT

Worked solution
text = "  Python  "
print(text.strip().upper())

Checks compare printed output, not your approach. Several solutions can be valid.

← Back to courses