Advertisement
pacho_the_python

task_two

Dec 3rd, 2023
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import re
  2.  
  3. collection_of_eggs = input()
  4. pattern = r"([@#]+)([a-z]{3,})([@#]+)([^\w\d]+)?([\/]+)([0-9]+)([\/]+)"
  5. matches = re.findall(pattern, collection_of_eggs)
  6.  
  7. for current_tuple in matches:
  8.     if int(current_tuple[5]) == 0:
  9.         continue
  10.     print(f"You found {current_tuple[5]} {current_tuple[1]} eggs!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement