From 2bf88a27a1004ae79179f2ab4d36be7180f1d3aa Mon Sep 17 00:00:00 2001 From: Phil <2121464@stud.hs-mannheim.de> Date: Mon, 9 Jan 2023 14:25:06 +0100 Subject: [PATCH] Bruh --- 1.py | 10 ++++++++++ 2.py | 8 ++++++++ 4.py | 15 +++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 1.py create mode 100644 2.py create mode 100644 4.py diff --git a/1.py b/1.py new file mode 100644 index 0000000..d5e0067 --- /dev/null +++ b/1.py @@ -0,0 +1,10 @@ +class ThomasMüller: + pass + +class MoritzLutz(ThomasMüller): + pass + +class MiriNahimiaLutz(ThomasMüller, MoritzLutz): + pass + + diff --git a/2.py b/2.py new file mode 100644 index 0000000..905a735 --- /dev/null +++ b/2.py @@ -0,0 +1,8 @@ +import re + + +bruh = "If the the problem is textual, use the the re module" + +txt = re.sub("the the", "the", bruh) + +print(txt) \ No newline at end of file diff --git a/4.py b/4.py new file mode 100644 index 0000000..7efdd9d --- /dev/null +++ b/4.py @@ -0,0 +1,15 @@ +import re + +def normalize(number): + pattern = re.compile(r'\+?1?.?.?([2-9]\d{2}).?.?(\d{3}).?([2-9][0-8]\d{2}$)') + + + tmp = pattern.match(number) + if(tmp): + return '1' + '-' + tmp.group(1) + '-' + tmp.group(2) + '-' + tmp.group(3) + else: raise ValueError('Ungültige Telefonnummer') + +bruh = normalize("1-989-111-2222") +print(bruh) + +