import random
passlen = int(input("enter the length of password"))
s = "abimport random
passlen = int(input("enter the length of password"))
s = "abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUV WXYZ!@#$%^&*()?"
p = "".join(random.sample(s,passlen ))
print(p
I answerd the first question on the console but this did not lead to the second
import random
passlen = int(input("enter the length of password"))
s = "abimport random
passlen = int(input("enter the length of password"))
s = "abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUV WXYZ!@#$%^&*()?"
p = "".join(random.sample(s,passlen ))
print(p)
import random
passlen = int(input(“enter the length of password”))
s = "abimport random
passlen = int(input(“enter the length of password”))
s = “abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUV WXYZ!@#$%^&*()?”
p = “”.join(random.sample(s,passlen ))
print(p)
With " at the end of line 3
The problem is that the firt input appears on the console when i put the length of password the second question does not appear
Just copy the link shown in the url bar when you are editing your repl and paste it here. Alternatively, you could click on the repl name the right click on Show Cover Page and select copy link.
Looking at your code, it seems you tried to paste the same code twice, here is what I think it should be (I’m not sure what “second question” you keep talking about though):
import random
passlen = int(input("enter the length of password: "))
s = "abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?"
p = "".join(random.sample(s, passlen))
print(p)