From d85d0bf7d764640ad87aa02b9250dd13ecf29d0c Mon Sep 17 00:00:00 2001 From: "Kerim R. S" <44273530+rsthecoder@users.noreply.github.com> Date: Sun, 21 Mar 2021 18:51:59 +0100 Subject: [PATCH 1/3] Find Hidden ID --- Find hidden ID.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Find hidden ID.py diff --git a/Find hidden ID.py b/Find hidden ID.py new file mode 100644 index 0000000..cf820a5 --- /dev/null +++ b/Find hidden ID.py @@ -0,0 +1,23 @@ +''' +Kerim Sak +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 + +def find_hidden_id(): + entered_text = input("Enter de text: ") + hidden_id = re.findall("\w{2}\d\w{2}\d{2}\w\d", entered_text)[0] + return hidden_id + +print(find_hidden_id()) \ No newline at end of file From b20be8f134711e7b4dc10ac329d333c5a2765613 Mon Sep 17 00:00:00 2001 From: "Kerim R. S" <44273530+rsthecoder@users.noreply.github.com> Date: Sun, 21 Mar 2021 19:01:27 +0100 Subject: [PATCH 2/3] Find Email --- Find Email.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Find Email.py diff --git a/Find Email.py b/Find Email.py new file mode 100644 index 0000000..beb30b3 --- /dev/null +++ b/Find Email.py @@ -0,0 +1,27 @@ +''' +Kerim Sak +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 + +def find_email(): + entered_text = input("Enter de text: ") + pattern = '([\w\d]+)@[\w\d]+' + emails = re.findall(pattern, entered_text) + + return emails + +print(find_email()) \ No newline at end of file From 36f3674d6f26bc27a4f3db7376b88fc274555a6c Mon Sep 17 00:00:00 2001 From: "Kerim R. S" <44273530+rsthecoder@users.noreply.github.com> Date: Sun, 21 Mar 2021 19:08:59 +0100 Subject: [PATCH 3/3] Find the words - 8 letter long --- Find 8 letter long.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Find 8 letter long.py diff --git a/Find 8 letter long.py b/Find 8 letter long.py new file mode 100644 index 0000000..af2c559 --- /dev/null +++ b/Find 8 letter long.py @@ -0,0 +1,24 @@ +''' +Kerim Sak +Find words that are 8 letter long on this text ; + +Without, the night was cold and wet, but in the small parlour of Laburnum villa the blinds were drawn and the fire burned brightly. +Father and son were at chess; the former, who possessed ideas about the game involving radical chances, putting his king into such +sharp and unnecessary perils that it even provoked comment from the white-haired old lady knitting placidly by the fire. "Hark at +the wind," said Mr. White, "who, having seen a fatal mistake after it was too late, was amiably desirous of preventing his son from +seeing it. I'm listening," said the latter grimly surveying the board as he stretched out his hand. "Check." I should hardly think +that he's come tonight," said his father, with his hand poised over the board. "Mate," replied the son. "That's the worst of living +so far out," balled Mr. White with sudden and unlooked-for violence; "Of all the beastly, slushy, out of the way places to live in, +this is the worst. Path's a bog, and the road's a torrent. I don't know what people are thinking about. I suppose because +only two houses in the road are let, they think it doesn't matter." +''' + +import re + +def find_8s(): + entered_text = input("Enter de text: ") + pattern = '[a-z]{8}' + words_eight= re.findall(pattern, entered_text) + return words_eight + +print(find_8s())