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()

I dont see a return statement in cadena_aletoria(). It means that it returns None instead of a string.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.