Write a Python program to demonstrate working of Swap Binary substring


Topic: Write a Python program to demonstrate working of Swap Binary substring

Solution

test_str = "geeksforgeeks"
print("The original string is : " + test_str) 
temp = str.maketrans("geek", "abcd") 
test_str = test_str.translate(temp) 
print("The string after swap : " + test_str) 



List all Python Programs