Strings and Type Conversion
Work with string values and convert between different data types.
Introduction
Strings in Python are immutable sequences of Unicode characters, created with single or double quotes. Type conversion lets you switch between types.
Creating Strings
Use single quotes, double quotes, or triple quotes for multi-line strings. All create the same str type.
s = 'hello'
t = "world"
ml = '''line1
line2'''All lessons in this course
- Variables and Assignment
- Numeric and Boolean Types
- Strings and Type Conversion
- Reading User Input