Python Project 2 | Password Generator in Python | Python for Beginners #lec49

preview_player
Показать описание
In this lecture We will learn how to create a Random Password Generator using Python. In this Random Password Generator, the user will be required to enter How many letters, symbols and numbers user want in his password after which he'll be provided with a random password. Here, we'll be using the 'random' module in Python to create our project

*********************************************

Connect & Contact Me:

*******************************************

More Playlists:

#coding #pythonforbeginners #python #jennyslectures #pythonprogramming #projects
Рекомендации по теме
Комментарии
Автор

import random
import string
password=''
print('welcome to password generator')
for i in range(int(input('enter how many letters')))]
for i in range(int(input('enter how many numbers')))]
for i in range(int(input('enter how many symbols')))]
key=words+numbers+symbol
random.shuffle(key)
for i in key:
password=password+i
print(password)

seenumadhavan
Автор

Mam I've made GUI base one but that doesn't ask for such conditions 😂
I loved this one and can't wait to try this soon❤❤

swarnimdubey
Автор

Mam thanks for your class then I will your video and I will learn the python course

kusmareddy
Автор

Thank u mam for ur wonderful presentation.

sugan
Автор

Instead of typing all alphabets u can use this :



import random

letter=[]
for i in range(ord('a'), ord('z')+1):
letter.append(chr(i))
for i in range(ord('A'), ord('Z')+1):
letter.append(chr(i))
print(letter)

number=[]
for i in range(10):
number.append(i)
number[i]=str(number[i])
print(number)

symbol=['!', '@', '#', '$', '%', '&', '*', '(', ')', '+']

print("Welcome to the passworrd generator.")
letters=int(input("How many letters would you like in your password? "))
numbers=int(input("How many numbers would you like? "))
symbols=int(input("How many symbols would you like? "))
password_list=[]

for i in range(1, letters+1):
a=random.choice(letter)
password_list+=a
for i in range(1, numbers+1):
b=random.choice(number)
password_list+=b
for i in range(1, symbols+1):
c=random.choice(symbol)
password_list+=c


password=""
for i in password_list:
password+=i
print(password)

ritikpatel
Автор

Easy steps for layman to understand the Program Coding:

It first imports the random module, which is used to generate random numbers or select items at random.
It then defines lists of lowercase and uppercase letters, numbers, and special symbols.
The program prompts the user to enter the number of letters, symbols, and numbers they want in their password.
It then generates a list of characters for the password. It does this by randomly selecting the specified number of letters, symbols, and numbers from the respective lists and adding them to the password_list.
The random.shuffle function is used to shuffle the characters in the password_list to ensure the password is random and not predictable (i.e., it doesn’t just have all the letters first, then the symbols, then the numbers).
Finally, it joins all the characters in the password_list into a single string and prints the generated password.
So, if you run this program and follow the prompts, it will generate a random password for you based on your specifications. This can be useful for creating secure passwords. Please remember to always keep your passwords safe and secure! 🔒

muneebbolo
Автор

Thank you so much mam please continue python mam

rongalamanindra
Автор

Mam, Thankyou very much for coming back 🎉🎉🎉

ravadarajasehkar
Автор

import random
import string

print ('Welcome to password generator')
n = int(input('How many numbers do you want ? '))
l = int(input("How many letters do you want ? "))
c = int(input("How many capital letters do you want ? "))
s = int(input('How many symbols do you want to have in your password ? '))

letters = random.choices(string.ascii_lowercase, k = l)
cap = random.choices(string.ascii_uppercase, k = c)
r = random.choices(range(0, 10), k = n)
sym = random.choices(string.punctuation, k = s)

p = (letters + r + sym + cap)
random.shuffle(p)

for item in p:
print (item, end = '')

RitwikSharma-wqvu
Автор

I used random.choices and set K= user input to generate random characters from letters, numbers and symbols in the easy part.
In the hard part, I updated the lists into a set and printed the set since I knew that it would shuffle its contents randomly.

mwangikagwi
Автор

Mam, please continue c++ series mam.. We are waiting

soorya_kv
Автор

import random
print("Welcome to the Password Generator!")

letters=int(input("How many letters you want in your password?\n"))
symbols=int(input("How many symbols you want in your password?\n"))
numbers=int(input("How many numbers you want in your password?\n"))

if((letters<0) or (symbols<0) or (numbers<0)):
print("Invalid input.")

else:
list = []

for i in range(0, letters):
random_letters = random.choice(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
list.append(random_letters)

for i in range(0, symbols):
random_symbols = random.choice(['!', '#', '$', '%', '&', '(', ')', '*', '+'])
list.append(random_symbols)

for i in range(0, numbers):
random_numbers = random.choice(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])
list.append(random_numbers)

print(f"List before shuffling : {list}")

random.shuffle(list)

print(f"List after shuffling : {list}")

if(len(list)==0):
print("No password generated.")

else:
password = ''
for i in list:
password = password + i

print(f"Your password is : {password}")

raghavsanoria
Автор

import random
import string
print("Welcome to Password Generator!")
password=[]
a=int(input("Enter how many letters would you like in password:"))
for i in range(a):


b=int(input("Enter how many symbols would you like:"))
for j in range(b):

password.append(rand_symbol)
c=int(input("Enter how many numbers would you like:"))
for k in range(c):
rand_num=str(random.randint(0, 9))
password.append(rand_num)
random.shuffle(password)
result=''.join(password)
print(result)

SravaniGrandhisila
Автор

we can give directly in range function the value as n-letters, n_symbols without starting from 1 it will directly run the loop for the same number of letters or symbols that user will give

karimwazahat
Автор

Thank you mam and we love you❤ you are very useful to us

itsme-smjp
Автор

Mam please respond mam 🙏🙏🙏🙏🙏🙏🙏🙏😭😭😭😭😭 when will you continue C++ series mam.. completed C and eagerly waiting for C++ please continue mam upload full course 🥺🥺🙏🙏🥺🙏🙏🥺🙏

paavaneep
Автор

Tnx Jenny mam interesting project you teach 😘👏👏

pravinsingh
Автор

Di, I am clear 12th class this year. (I am waiting result).
I want to study AI and machine Learning.
What, I am doing? Next
Means that what course and program I chose.
To become a AI and machine learning expert.

questionmark
Автор

Please provide the code files and the links in the description as soon as possible for free 🙏 thank you so much.

pandipatipavan
Автор

Sister pls I want more projects on python

praneethamalakapalli