From 436e046a93138f1635faa926735892cdd8cafac8 Mon Sep 17 00:00:00 2001 From: Elham Fazel <55910811+fazelelham32@users.noreply.github.com> Date: Sat, 31 Aug 2024 00:25:28 +0330 Subject: [PATCH] source code6-projects --- 6-1.py | 19 +++++++++++++++++++ 6-2.py | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 6-1.py create mode 100644 6-2.py diff --git a/6-1.py b/6-1.py new file mode 100644 index 0000000..9e616fc --- /dev/null +++ b/6-1.py @@ -0,0 +1,19 @@ + +# Created by Hamidreza Talebi + +import re + +def main(): + fh = open('raven.txt') + for line in fh: + if re.search('(Len|Neverm)ore', line): + print(line, end='') + + +if __name__ == "__main__": main() + + + + + + diff --git a/6-2.py b/6-2.py new file mode 100644 index 0000000..6dd2830 --- /dev/null +++ b/6-2.py @@ -0,0 +1,17 @@ + +# Created by Hamidreza Talebi + +import re + +def main(): + fh = open('raven.txt') + for line in fh: + print(re.sub('(Len|Neverm)ore','###', line), end='') + +if __name__ == "__main__": main() + + + + + +