DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

Strings — Example 40

Quick explanation + ready code for: Strings.

Python Strings Back to examples
Back to language
Syntax: Strings in Python. ID: #40

Code

s = "lesson-12"
print(s.upper(), ("lesson" in s))

Notes

You can copy this snippet and adapt it. For advanced, add real-world inputs, edge cases, and tests.