From b65cbc3b4ed616e9986fe39e13a9e3de04edb6a8 Mon Sep 17 00:00:00 2001 From: Emrah Cinar <76920956+EmrahNL55@users.noreply.github.com> Date: Wed, 24 Feb 2021 15:02:10 +0100 Subject: [PATCH 1/3] @secedit week7_1 --- week7_1.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 week7_1.py diff --git a/week7_1.py b/week7_1.py new file mode 100644 index 0000000..39d5226 --- /dev/null +++ b/week7_1.py @@ -0,0 +1,23 @@ +print('*'*21) + +'''Write a program that detects the ID number hidden in a text. We know that the format of the ID number is 2 letters, 1 digit, 2 letters, 2 digits, 1 letter, 1 digit (For example: AA4ZA11B1). +Input : AABZA1111AEGTV5YH678MK4FM53B6 Output : MK4FM53B6 +Input : AEGTV5VZ4PF94B6YH678 Output : VZ4PF94B6''' + +import re #RegEx import edilir + +id_find=input('Enter the txt: ') #enter text + +patern=r"\w{2}\d\w{2}\d{2}\w\d" #patern created.two character, one digit two char.two digit,one char,one digit + +for match_find in re.findall(patern,(id_find.upper())):#assigment to match_find + print(match_find) + + +################################################# +print() # +a="Sharp" # +print(('*'*(50)).center(50)) # +print(f'Look {a}, Act {a}, Be {a}'.center(15)) # +print('E.Cinar.'.center(60)) # +################################################# \ No newline at end of file From 3a92f6e4d592adba254d08772686ac6215e8761e Mon Sep 17 00:00:00 2001 From: Emrah Cinar <76920956+EmrahNL55@users.noreply.github.com> Date: Wed, 24 Feb 2021 15:09:14 +0100 Subject: [PATCH 2/3] Add files via upload week7_2 --- week7_2.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 week7_2.py diff --git a/week7_2.py b/week7_2.py new file mode 100644 index 0000000..6f5a000 --- /dev/null +++ b/week7_2.py @@ -0,0 +1,17 @@ + '''Find words that are 8 letter long on this text ;''' + +import re +with open('letter8.txt','r') as let_8: #open file with read mode. and assigmented let_8 + type=let_8.read() + patern=r"\w{8}" #creaated patern + for result in re.findall(patern,type): + print(f'{result}') + + +################################################# +print() # +a="Sharp" # +print(('*'*(50)).center(50)) # +print(f'Look {a}, Act {a}, Be {a}'.center(15)) # +print('E.Cinar.'.center(60)) # +################################################# \ No newline at end of file From f4cb23810655f19c1b27c5d310b091f8b87809f9 Mon Sep 17 00:00:00 2001 From: Emrah Cinar <76920956+EmrahNL55@users.noreply.github.com> Date: Wed, 24 Feb 2021 15:19:17 +0100 Subject: [PATCH 3/3] @secedit --- week7_3.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 week7_3.py diff --git a/week7_3.py b/week7_3.py new file mode 100644 index 0000000..221bf68 --- /dev/null +++ b/week7_3.py @@ -0,0 +1,25 @@ +'''Write a program that list according to email addresses without email domains in a text. +Example: +Input :The advencements in biomarine studies franky@google.com with the investments necessary and Davos sinatra123@yahoo.com. + Then New Yorker article on wind farms... +Output : franky sinatra123''' + +import re #RegEx import edilir + +et='The advencements in biomarine studies franky@google.com with the investments necessary and Davos sinatra123@yahoo.com.' + +patern=r"\w+[@]" #karakter ile baslayan ve @ ile biten patern olusturulur. +nummer=0 #bulunan sonuclari numaralandirmak icin; +for i in re.findall(patern,et): #findall methodu ile bulunan string i atanir + nummer+=1 + i=i.strip('@') #stringde bulunan @ karakteri strip kullanilarak cikartilir + print(f'{nummer}.{i}') + + +################################################# +print() # +a="Sharp" # +print(('*'*(50)).center(50)) # +print(f'Look {a}, Act {a}, Be {a}'.center(15)) # +print('E.Cinar.'.center(60)) # +################################################# \ No newline at end of file