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
2 changes: 2 additions & 0 deletions maths/matrix_exponentiation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Matrix Exponentiation"""

from __future__ import annotations

import timeit

"""
Expand Down
4 changes: 3 additions & 1 deletion web_programming/fetch_well_rx_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def fetch_pharmacy_and_price_list(drug_name: str, zip_code: str) -> list | None:

return pharmacy_price_list

except httpx.HTTPError, ValueError:
except httpx.HTTPError:
return None
except ValueError:

@cclauss cclauss Jun 25, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An except clause may name multiple exceptions, for example:

... except RuntimeError, TypeError, NameError:
...     pass

https://docs.python.org/3/tutorial/errors.html#handling-exceptions

return None


Expand Down
4 changes: 3 additions & 1 deletion web_programming/instagram_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def get_json(self) -> dict:
scripts = BeautifulSoup(html, "html.parser").find_all("script")
try:
return extract_user_profile(scripts[4])
except json.decoder.JSONDecodeError, KeyError:
except json.decoder.JSONDecodeError:
return extract_user_profile(scripts[3])
except KeyError:
return extract_user_profile(scripts[3])

def __repr__(self) -> str:
Expand Down