+ 1

is there anything wrong in this please answer import string from random import * letters = string.ascii_letters digits = string.digits chars = letters + digits min_length = 9 max_length = 15 password = "".join(choice(chars) for x in range(randint(min_length, max_length))) print(password)

17th Sep 2016, 3:31 PM
Urjasvi Suthar
Urjasvi Suthar - avatar
4 ответов
+ 2
I've tested your code, and it works. What is the error you are getting?
17th Sep 2016, 4:00 PM
Zen
Zen - avatar
+ 2
I tested it in Code Playground. And your error suggests that you aren't putting proper line breaks. Here is the code with line breaks: import string from random import * letters = string.ascii_letters digits = string.digits chars = letters + digits min_length = 9 max_length = 15 password = "".join(choice(chars) for x in range(randint(min_length, max_length))) print(password)
17th Sep 2016, 4:26 PM
Zen
Zen - avatar
+ 1
syntax error: multiple statements found while compiling a single statement
17th Sep 2016, 4:02 PM
Urjasvi Suthar
Urjasvi Suthar - avatar
+ 1
where did u test it
17th Sep 2016, 4:02 PM
Urjasvi Suthar
Urjasvi Suthar - avatar