Skip to content

Commit

Permalink
Merge pull request #5252 from MiguelMillones/miguelmillones
Browse files Browse the repository at this point in the history
Reto #11 - Python
  • Loading branch information
kontroldev authored Oct 7, 2023
2 parents 95ce0dc + 0f535c7 commit 7049201
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Retos/Reto #11 - URL PARAMS [Fácil]/python/miguelmillones.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'''Dada una URL con parámetros, crea una función que obtenga sus valores.
No se pueden usar operaciones del lenguaje que realicen esta tarea directamente.
*
* Ejemplo: En la url https://retosdeprogramacion.com?year=2023&challenge=0
* los parámetros serían ["2023", "0"]
'''
VALUES=[]

def url_parameter(url):
value=''
point=[]
tamano=len(url)
P=0
while P<tamano:
point=url[P]
if point=='=':
while not url[P+1]=='&':
P+=1
value=value+url[P]
if P==tamano-1:
url=url+'&'
VALUES.append(value)
value=''
P+=1
return VALUES

URL=input("Ingrese url: \n")
print(url_parameter(URL))

0 comments on commit 7049201

Please sign in to comment.