Programs of String Operations
Implement copy, concatenate, search and reverse operations for strings.
We'll cover the following...
Copy a string
In Python, individual characters in a string can be accessed but not assigned or modified.
The following program copies a string to another string:
Press + to interact
Press + to interact
src = 'Just a string' # The string to be copiedlsrc = len(src) # Calculating the length of srcdst = '' # Creating an empty stringfor index in range(lsrc):dst += src[index] # Copying data from src to dst character by characterprint (src)print (dst)
String concatenation
Concatenation means appending a ...