From 1fa03c2b0a89465dd76798d2820c0c7c258f64f6 Mon Sep 17 00:00:00 2001 From: Lukas Baumann Date: Thu, 18 Feb 2021 08:23:30 +0100 Subject: [PATCH] Create 1 - The Replacements.py --- 1 - The Replacements.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 1 - The Replacements.py 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)