Python Lab Day 3 Codes
Python Lab Day 3 Codes
import random
letters =
['q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j',
'k','l','z','x','c','v','b','n','m','Q','W','E','R','T','Y','U','I',
'O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M'
]
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
print("Welcome to the PyPassword Generator!")
# password = ''
# for char in range(0 , nr_letters):
# password += random.choice(letters)
# print(password)
password_list = []
random.shuffle(password_list)
password =''
for char in password_list :
password += char
Output :
# Use bin() to convert decimal to binary and [2:] to remove the "0b"
prefix
return bin(decimal)[2:]
# Use hex() to convert decimal to hexadecimal and [2:] to remove the "0x"
prefix
return hex(decimal)[2:]