Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 1.35 KB

introduction.md

File metadata and controls

15 lines (11 loc) · 1.35 KB

Introduction

A str in Python is an immutable sequence of Unicode code points. These may include letters, diacritical marks, positioning characters, numbers, currency symbols, emoji, punctuation, various spaces, line breaks, and more.

Strings implement all common sequence operations and can be iterated through using for item in <str> or for index, item in enumerate(<str>) syntax. They can be concatenated with +, or via <str>.join(<iterable>), split via <str>.split(<separator>), and offer multiple formatting and assembly options.

To further work with strings, Python provides a rich set of string methods that can assist with searching, cleaning, transforming, translating, and many other operations. Being immutable, a str object's value in memory doesn't change; methods that appear to modify a string return a new copy or instance of that str object.