Created
July 12, 2021 13:50
-
-
Save martin-martin/6c9332e42a37f65ae3e814a94705f659 to your computer and use it in GitHub Desktop.
Revisions
-
martin-martin created this gist
Jul 12, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ from pathlib import Path import re with open('outline.md', 'r') as f_in: content = f_in.read() # Finds all time mentions in the format shown below pattern = r'\((\d+)\smin\)' # (3 min) minutes = re.findall(pattern, content) # print([int(m) for m in minutes]) total_time = sum([int(m) for m in minutes]) print(total_time)