diff --git a/1 - The Replacements.py b/1 - The Replacements.py new file mode 100644 index 0000000..11dfefe --- /dev/null +++ b/1 - The Replacements.py @@ -0,0 +1,5 @@ +def replace(l, X, Y): + while X in l: + i = l.index(X) + l.pop(i) + l.insert(i, Y)