Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Python

Strings in Python

Create and work with text using Python string literals, indexing, and slicing.

Strings in Python — a practical guide to Python strings with clear examples you can reuse in real projects.

Python Tutorial Series (19/95). Prefer one article? Read the complete Python tutorial.

Short description

Strings are immutable sequences of characters. Use quotes, f-strings, indexing, and slices.

String basics

s = 'Python'
print(s[0], s[-1], s[0:3])
print(f'Length: {len(s)}')

Leave a reply

Your email address will not be published. Required fields are marked *