python logo

Strings Concatenation, Indexing, Slicing

Concatenation Strings can be added to each other name = "Kei" message = "Good morning," print(message + name) Strings are immutable, it can’t be changed although it can be reassigned with the same variable name but they are stored in different memory location name = "Kei" message = "Good morning," print(id(message)) message = message + " " + name print(id(message)) Indexing Strings are sequence of characters therefore they can be indexed....

February 11, 2022 · 1 min · Kei