Skip to content

Commit

Permalink
Merge pull request mouredev#4364 from ShinMugenNoKabe/reto11
Browse files Browse the repository at this point in the history
Reto mouredev#11 - Python
  • Loading branch information
Roswell468 authored Jul 30, 2023
2 parents ea6f236 + 598f650 commit 0d9c842
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Retos/Reto #11 - URL PARAMS [Fácil]/python/ShinMugenNoKabe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
def get_paramteres(url: str) -> list[str]:
if not "?" in url:
return []

query = url.split("?")[1]
params = query.split("&")

return [param.split("=")[1] for param in params]


if __name__ == "__main__":
result = get_paramteres("https://retosdeprogramacion.com?year=2023&challenge=0")
assert result == ["2023", "0"]
print(result)

0 comments on commit 0d9c842

Please sign in to comment.