khaos77 / 100-days

1 stars 0 forks source link

dia 15 #1

Open jorgelcq opened 5 months ago

jorgelcq commented 5 months ago

algo así me salio, pero no estoy tan seguro 👍🏻

cantidad_lista = int(input(""))
lista_index = []
lista_mensaje = []
inicial = 0
u = 0
mensaje = []

for i in range(1, cantidad_lista + 1):
    ni = input("")
    j, k = ni.split(sep = " ")
    lista_index.append(int(j))
    lista_mensaje.append(k)

print("\n")

for n in range(1, cantidad_lista + 1):   
    inicial += 1
    boolean = True
    for i in range(1, cantidad_lista + 1):
        if inicial == lista_index[u] and boolean == True:
            mensaje.append(lista_mensaje[u])
            u = 0
            boolean = False 
        elif inicial == lista_index[u] and boolean == False:
            pass
        else:
            u += 1
    u = 0            

mensaje_string = "".join(i for i in mensaje)

print(mensaje_string)
jorgelcq commented 5 months ago

eso.. y quería probar esto en github xd