"Ram"+"Kumar"
Output:
"RamKumar"
2*"Rahul"
Output:
"RahulRahul"
str="Rahul" str[2:5]
Output:
hu
"rahul".capitalize()
Output:
Rahul
name = "Hello How Are You?" substring = "Are" count = name.count(substring) print("The count is:", count)
Output:
The count is: 2
name="Welcome to Python"; substring="Python"; print name.endswith(substring);
Output:
True
str="Welcome to Python"; substr1="to"; substr2="Python"; print str.find(substr1); print str.find(substr2);
Output:
8
11