+ 4

Help me in python

I need to add a password generator help me solve here is my code https://code.sololearn.com/cIRpAlMXcV4h/?ref=app

8th Apr 2021, 12:35 PM
Codemurai
Codemurai - avatar
24 Answers
+ 7
Codemurai ```python import random l = list(range(5)) print(l) # [0, 1, 2, 3, 4] random.shuffle(l) print(l) # [4, 3, 2, 1, 0] ```
17th Apr 2021, 2:30 PM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 4
What problems you got, the code works correctly
8th Apr 2021, 12:38 PM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 3
Ananiya Jemberu How do I shuffle do a demo code
17th Apr 2021, 2:25 PM
Codemurai
Codemurai - avatar
+ 2
Help me to do this I know lists but........................................show me
8th Apr 2021, 12:52 PM
Codemurai
Codemurai - avatar
+ 2
Ananiya Jemberu Thanks But please show a code I don't know how to place
17th Apr 2021, 2:34 PM
Codemurai
Codemurai - avatar
+ 1
There is no problem I mean help me to add a password generator
8th Apr 2021, 12:43 PM
Codemurai
Codemurai - avatar
+ 1
After you click on run option , an dialog box will appear type any name in that , the project will work! Make sure the name is valid Hope this helps you! #check my projects for more info!
18th Mar 2022, 5:37 PM
Hrithika
Hrithika - avatar
+ 1
import random length=int(input('Length of password=')) lower = 'abcdefghijklmnopqrstuvwxyz' upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' num = '1234567890' symbols = '[email protected]#$%^&*()_+-=/?' all = lower + upper + num + symbols temp = random.sample(all,length) password=''.join(temp) print(password)
11th Jul 2022, 8:31 AM
Aditya Adak
+ 1
abc 123 since you're just concatenating them all together anyways, why not just make one variable with all available characters? You're also redefining the builtin "all", which is something you shouldn't do, unless you know what you're doing and intend on doing so. Sample is also a bad choice here, as it only returns items from the list, without repeating. That narrows down a lot of what each character CAN be, and open to brute force attack. It also lacks for future feature implementation.
11th Jul 2022, 8:51 AM
Benjamin Rogers
Benjamin Rogers - avatar
0
Hint: use random store it as a list then shuffle it
8th Apr 2021, 12:49 PM
Ananiya Jemberu
Ananiya Jemberu - avatar
0
What if the person's name is Jane or Kate or a four letter noun I suggest you use >=4 name = str(input()) if (len(name) >= 4): print("welcome " + name) print("HERE IS YOUR DATA") print("name:" + name) else: print("INVALID NAME")
17th Apr 2021, 2:10 PM
CAPSPY
CAPSPY - avatar
0
Eg ```python random.shuffle(list("%","
quot;,"*",1,2,3,4,5, 6) ```
17th Apr 2021, 3:42 PM
Ananiya Jemberu
Ananiya Jemberu - avatar
0
Codemurai Before you can make a password generator, you need to define the rules of the password. How many characters does it need to be? Is it just alpha/alpha-numeric, or are symbols involved. Can it start with any letter/number/symbol, or does it have to start with a letter/numer? Does at least one character have to be capitalized? Then, you can build the generator.
31st May 2021, 11:36 PM
Benjamin Rogers
Benjamin Rogers - avatar
0
Hi
3rd Jun 2021, 10:59 AM
110 Navaneeth
110 Navaneeth - avatar
0
Hi
2nd Sep 2021, 11:10 PM
Andrea Vaghi
Andrea Vaghi - avatar
0
there is no problem in the code above?
2nd Jan 2022, 1:41 PM
Vishal Adithya
Vishal Adithya - avatar
0
Hi guys il having trouble completing question 3.1 in python
10th Jan 2022, 4:38 AM
Pietro Miccoli
0
Here's a sample for a password generator, lowercase, with a length of 10. from string import ascii_lowercase from random import choice def generate(length: int) -> str: passwd = [choice(ascii_lowercase) for i in range(0x0, length)] return "".join([p for p in passwd]) print(generate(10))
9th Feb 2022, 6:46 PM
Xander Tedder
0
Hello
21st Feb 2022, 5:56 AM
Shobhit Boy