Password generator in Python!

preview_player
Показать описание

python, C, C++, Java, JavaScript and Other Cheetsheets [++]:

►Learn in One Video[++]:

►Complete course [playlist]:

Follow Me On Social Media
Comment "#HarryBhai" if you read this 😉😉
Рекомендации по теме
Комментарии
Автор

Password generator can be made like this-

#password generator
import string
import random

passlen=int(input('Enter password lenth ' ))
s1=string.ascii_lowercase
s2=string.ascii_uppercase
s3=string.punctuation
s4=string.digits

s=[]
s.extend(s1)
s.extend(s2)
s.extend(s3)
s.extend(s4)

random.shuffle(s)
print(''.join(s[0:passlen]))

pythonwithak
Автор

We can modify it using file handling. First, we get the user's input for the name under which the password should be saved. Then, we generate the password and ask the user if they accept it. If the user says 'yes, ' we save it in a text file with the given name.

MuhammadAsadSeo
Автор

Harry bhai maine aapka html, css and js with notes wala couce poora dekha hai and they were amazing
Plz launch a backend with notes it would be helpful !🙏🙏🙏 ❤❤❤❤

anmolgumbhir
Автор

Instead of writing all the characters you can also import:
string.ascii_lowercase
string.ascii_uppercase
string.punctuation
string.digits
from string module.

isumithere
Автор

Hum alphabet, special symbols and numbers alag alag list me le lenge aur for loop chala kr randomly tino me se alag alag character leke ek string banayenge. Ban gaya strong password

Mr.dhaneshwar
Автор

if we make 3 diff strings for letters, numbers and for characters separately by which we cant select the amt of each category coming in our password and then combine all the 3 it would be much stronger

shashwat
Автор

First, there should be different variables for each i.e. upper, lower, punctuation and digits.

And according to the password length, you should take parts of the characters randomly from each variable and merge them in a single variable .
For ex. 25% upper chars,
Next 25% lower chars,
Next 25% punctuations
And the last 25% for digits.

Your merged variable length should be password length.

Then suffle this merged variable and your password is ready.

This will be more strong password because it is containing upper, lower, special chars and digits in all the passwords.
😁

tarunsinha
Автор

Reminds me xkcd comic on why these passwords are actually less efficient.
Must read

StudyLOL.
Автор

Adding an if condition before randome choice
If len(password)<12:
char=random.choice(chars)
If char not in password:
password +=char

chandanbl
Автор

you can make different arrays of type of charcacters say onr will contain lower cases, one upper case, one numbes and one symbol, and then take equal number of entries from all, and shuffle that( it can be done by keeping every entry of the password in an array again, and using rand function for indices, everytime an index comes it should be printed and a check is needed to map the used characters of the password array, please comment about how did u like my approach.

utsav
Автор

Nice Harry bro but I made it more easier and blockbuster 🎉🎉🎉

Coders try this :-

import random as rdm
import string

Password = "".join(rdm.sample(string.ascii_letters+string.digits+string.punctuation, 6))
print(Password)

adityascoding
Автор

New Web development course with emerging technologies like chatgpt A.I etc

raeesahmed
Автор

10 letter of word in which we can use any random as upper case lower case numbers, and symbols and all are must atleast 2 should be in appled in the following ways

sushantnichat
Автор

Harry bhaiya ek help kardo please ye question ka answer bata doo please 😭😭😭😭😭😭😭😭😭😭
1.Write a Pl/SQL program to calculate Area of rectangle whose length = 20 and width= 10
Ot= 200
2.Write a Pl/SQL program to find sum of first 10 natural nos.
Ot=55
Bhai please bata doo 😭😭😭😭

kukigaming
Автор

a = string.printable
passw= "".join(random.choice(a) for x in range(10))
print (passw)

ravilipne
Автор

Bhai you can you string module instead of typing every single letter, digit and punctuation.

mr.technoid
Автор

I think we must also do length +1 bcz for ex if user want 5 length password but the range function goes till 4 only so what you think??

rakshitjain
Автор

We can make it secure by that a password generated can not be repeated

Gaming_Crusaders
Автор

You can take characters in different variables in it 2 characters will come from each variable, because of this password will have characters of each type Ex- 2_alphabet 2_capital_alphabet 2_symbol 2_numbers and this will be a strong password

gautambaldaniya
Автор

Add some from AES encryption algorithm

satishbhuktar