Answers for "password generator python"

7

password generator python

import string
from random import *
characters = string.ascii_letters + string.punctuation  + string.digits
password =  "".join(choice(characters) for x in range(randint(8, 16)))
print password
Posted by: Guest on July-26-2020
5

python password generator

import random
chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@£$%^&*().,?0123456789'

number = input('Please enter a number of passwords.')
try:
    number = int(number)
except:
    print("Error, please enter a number!")

length = input('Length of password?')
try:
    length = int(length)
except:
    print("Error, please enter a number!")

print('\nHere are your password(s):')

for pwd in range(number):
  password = ''
  for c in range(length):
    password += random.choice(chars)
  print(password)
Posted by: Guest on July-04-2020
1

python random password generator

import random

alph = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ\
             abcdefghijklmnopqrstuvwxyz\
             1234567890 !@#$%^&*(){}[]<>,.')
out = ''
for char in string:
    out += random.choice(alph)
    
print(out)
Posted by: Guest on April-08-2020
3

password generator python

#This is giving you a password with 8 strings and 4 numbers:
import random
i=0 
list=[]
while i < 12:
    while i < 8:
        list.append(random.choice(string.ascii_letters))
        i+=1
    while i < 12:
        list.append(random.randint(0, 9))
        i+=1
    
list=' '.join([str(elem) for elem in list])
print("Your new password: ", list.replace(" ", ""))
Posted by: Guest on November-13-2020
3

python password generator

import random
import string

x = str(input("Do you want a password? y/n "))

list = []
if x == "y":
    print("Alright!")
    for i in range(16):
        _1 = random.choice(string.ascii_letters)
        _2 = random.randint(1, 9)
        list.append(_1)
        list.append(_2)
else:
    print("ok")


def convert(list): 
      
    s = [str(i) for i in list] 
      
    res = "".join(s) 
      
    return(print(res))



convert(list)
Posted by: Guest on February-12-2021
1

random password generator in python project

import random
letters = ['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']
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
print("Welcome to the PyPassword Generator!")
nr_letters = int(input("How many letters would you like in your password?\n")) 
nr_symbols = int(input(f"How many symbols would you like?\n"))
nr_numbers = int(input(f"How many numbers would you like?\n"))
password_list = []
for char in range(1, nr_letters + 1):
  password_list.append(random.choice(letters))
for char in range(1, nr_symbols + 1):
  password_list += random.choice(symbols)
for char in range(1, nr_numbers + 1):
  password_list += random.choice(numbers)

random.shuffle(password_list)
password = ""
for char in password_list:
  password += char
print(f"Your password is: {password}")
Posted by: Guest on August-09-2021

Code answers related to "password generator python"

Python Answers by Framework

Browse Popular Code Answers by Language