Pythondex

Tutorial

String Operations in Python

In Python, strings are sequences of characters. You can combine strings or repeat them using concatenation and repetition operators.

1. Concatenation

You can join two or more strings using the + operator:

2. Repetition

You can repeat a string multiple times using the * operator:

3. Combining Concatenation and Repetition

You can mix both operations to create more complex strings:

Quick Recap

  • Concatenation (+): Combine strings
  • Repetition (*): Repeat strings multiple times

Using these operations, you can create dynamic messages and repeated patterns easily.