diff --git "a/Retos/Reto #11 - URL PARAMS [F\303\241cil]/python/JoseAntonioRuizGarcia.py" "b/Retos/Reto #11 - URL PARAMS [F\303\241cil]/python/JoseAntonioRuizGarcia.py" new file mode 100644 index 0000000000..410d790fff --- /dev/null +++ "b/Retos/Reto #11 - URL PARAMS [F\303\241cil]/python/JoseAntonioRuizGarcia.py" @@ -0,0 +1,27 @@ +URL = 'https://retosdeprogramacion.com?year=2023&challenge=0' + +def extractParams(url: str) -> list: + is_param = False + element = [] + params = [] + + for ch in url: + if ch == '=': + is_param = True + continue + + if ch == '&': + params.append(''.join(element)) + element = [] + is_param = False + + if is_param: + element.append(ch) + + params.append(''.join(element)) + print(params) + + return params + +if __name__ == '__main__': + params = extractParams(url=URL)