Use the CSV reader from Phase 04 to download all videos one by one and save a simple Markdown report.
- Import the CSV-reading function from
solutions/library.py. - Read the URLs from
data/video_urls.csv. - Download each video one by one.
- Measure the time for each download.
- Measure the total execution time.
- Create a simple Markdown report file manually inside the
reports/folder. - Add a short time and space complexity note to the Markdown report.
Your solutions/main.py should use the function you created in Phase 04:
import ...
if __name__ == "__main__":
...Use time.perf_counter():
import time
start = time.perf_counter()
# code to time goes here
end = time.perf_counter()
elapsed = end - startUse round() to show the time with 2 decimal points:
serial_time = round(elapsed, 2)
print(f"Serial execution: {serial_time}")Your terminal output should look like this:
Serial execution: XX.XX
First, manually create a new Markdown file inside the reports/ folder.
Suggested filename:
reports/sequential_report.md
Add this starter content to the file:
# Report
## Serial execution
Total time:After the file exists, update your Python code so it writes the real serial execution time into this Markdown file.
Also update the report with a short answer to this question:
What is the time complexity and space complexity of downloading the videos one by one?
Add your answer below the serial execution time:
## Complexity
Time complexity:
Space complexity:Run:
python solutions/main.pyConfirm that:
- The app reads URLs using the function from
solutions/library.py. - Videos download one by one. Check the
videos/folder. - A report appears in
reports/sequential_report.md. - The report includes a short time and space complexity note.
- The terminal prints
Serial execution: XX.XXwith the time rounded to 2 decimal points.