diff --git a/PythonReplaceString b/PythonReplaceString new file mode 100644 index 00000000..dd8780f6 --- /dev/null +++ b/PythonReplaceString @@ -0,0 +1,9 @@ +string = "geeks for geeks geeks geeks geeks" + +# Prints the string by replacing +# e by a +print(string.replace("e", "a")) + +# Prints the string by replacing only +# 3 occurrence of ek by a +print(string.replace("ek", "a", 3))