String is a collection of characters, python provides simple and easy way to manage or manipulate the string.
In Python, single character are also a string of length one and string in python are immutable.
String is Immutable :-
It means that at runtime we can not change the index value in the string like
s="mystring"
s[1]='a'
This will give an error
Program-
string1=""
string2="This is my string in python"
print(string1)
print(string2)
s1="Hello"+"world"
print(s1)
s1="Hello"*2
print(s1)
print(s1[0])
print(s1[0:3])
print(len(s1))
Output:-
This is my string in python
Hello world
HelloHello
H
Hel
10
-Here '+' operator in python have a capability to add all type of similar data type like we can add
int +int
float+ float
list+list
string+string
-And '*' is multiple string and number here then it repeat the string as per the number which is multiple.
-Len(string) computes the length of the string.