Close button

Are You Looking for Developers to Hire?
Have a Look at Our Bench Strength

Hire Developers
Close button
Python append to string - How is it done?

Python append to string - How is it done?

By Arun Kumar

Python append to string - How is it done?

In Python, strings are immutable, which means you cannot modify an existing string. To append to a string, you need to create a new string that contains the original string concatenated with the additional string.

Here are two ways to achieve this:

1. Using the + operator:

Using the + operator:

Output:

Using the + operator Output:

2. Using the ‘join()’ method:

Using the ‘join()’ method:

Output:

Using the ‘join()’ method Output:

Python append to string - How is it done?

Python append to string - How is it done?

Python append to string - How is it done?

Python append to string - How is it done?