The answer to this question this question suggests the following:
''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length))
It's close to your solution, but avoids having to type out the whole alphabet by using predefined values and avoids the use of map() and lambda.
The answer to this question suggests the following:
''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length))
It's close to your solution, but avoids having to type out the whole alphabet by using predefined values and avoids the use of map() and lambda.
The answer to this question suggests the following:
''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length))
It's close to your solution, but avoids having to type out the whole alphabet by using predefined values and avoids the use of map() and lambda.
The answer to this question suggests the following:
''.join(random.choice(string.ascii_uppercaseascii_lowercase + string.digits) for _ in range(Nlength))
It's close to your solution, but avoids having to type out the whole alphabet by using predefined values and avoids the use of map() and lambda. For your purpose, I think you'd want string.ascii_lowercase instead of string.ascii_uppercase.
The answer to this question suggests the following:
''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(N))
It's close to your solution, but avoids having to type out the whole alphabet by using predefined values and avoids the use of map() and lambda. For your purpose, I think you'd want string.ascii_lowercase instead of string.ascii_uppercase.
The answer to this question suggests the following:
''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length))
It's close to your solution, but avoids having to type out the whole alphabet by using predefined values and avoids the use of map() and lambda.
The answer to this question suggests the following:
''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(N))
It's close to your solution, but avoids having to type out the whole alphabet by using predefined values and avoids the use of map() and lambda. For your purpose, I think you'd want string.ascii_lowercase instead of string.ascii_uppercase.