Some Basic Python String Programs-3
Python program to move Word to Rear-end str1 = “Beta Python: Python for U ” word = “Python” #using slicing and find() str2 = str1[:str1.find(word)] + str1[str1.find(word) + len(word):] + word print(str2) #Output: Beta : Python for U Python #using replace() str3 = str1.replace(word,””) + word print(str3) #Output: Beta : for U Python Slicing extracts … Read more