Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions week7_1.py
Original file line number Diff line number Diff line change
@@ -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)) #
#################################################
17 changes: 17 additions & 0 deletions week7_2.py
Original file line number Diff line number Diff line change
@@ -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)) #
#################################################
25 changes: 25 additions & 0 deletions week7_3.py
Original file line number Diff line number Diff line change
@@ -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)) #
#################################################