0

I have a problem with concatenate strings in pyhton. I need to concatenate the string clave and cadena_aleatoria(x) while cadena_inicio is minor than 256. This is my script: Any help? .Thanks!

import sys
import random




x = random.randint(0,9)
def cadena_aleatoria(x):
        cadena = []
        cadena.append(x)
        while len(cadena)<10:
                x = random.randint(0,9)
                cadena.append(x)
        b = "".join(str(i) for i in cadena)

        print(b, end = "")

def cadena_inicio():
        clave = "5275328525062135755"
        cadena = clave + str(cadena_aleatoria(x))
        while len(cadena)<256:
                cadena = clave + str(cadena_aleatoria(x))


        print(cadena)
cadena_inicio()

Edited by psichoman5

2
Contributors
1
Reply
30
Views
2 Years
Discussion Span
Last Post by Gribouillis
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.