Help on the console

Please i am new to coding when i wrote this:

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

Hello @TarikTarik9, welcome to the community!

Please edit your post’s code to be formatted like this:

```languagename
Your code here
```

So that it is easier for staff and members of the community to help you with your issue!

Also see this guide on how to share your code:

PS: if you cannot edit your post, please read around a little to increase your trust level and let you access editing your posts.

cc: @QwertyQwerty88 @dragonhunter1 @MattDESTROYER @UMARismyname

missing a closing quote on line 3

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)

like that…

you also used the wrong type of quotation mark, and it looks like you copy pasted the beginning of your code into the middle…?

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

Discourse auto formatted it, it’s not their fault.

Why I hadn’t tried to help much yet.

In the code you’ve given us there is only 1 question, could you share a repl link instead?

I answerd the first question on the console but this did not lead to the second

Ps: i don’t know how to share a link yet

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.

https://replit.com/@TarikTarik9/Mdp-generator#main.py

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)

First : enter the lentgh of password i put 7 for example but then no password is generated

Even with your code being as it is, it seems to work for me.

You dirst entered the lentgh of password and what did you do

I entered 7 twice, and then it returned a password.

I have to enter 7 twice?

Because you have 2 input statements, yes. If you use the code I provided above, you would only have to input it once.

Maybe i have a problem with using stop and run on the console