This is my code… IDK what I am doing wrong (I just began coding like 3 months ago)
print("what passwords do you want to use? [please reply with soci, pers or buis for social media, personal or buisness respectively]")
1 == int(input('please enter'))
if 1== "soci":
import random
import string
total = string.ascii_letters
length = 8
password = "".join(random.sample(total, length))
print("Low level password. Commonly used for social media")
print(password)
if 1== "pers":
import random
import string
total = string.ascii_letters + string.digits
length = 10
password = "".join(random.sample(total, length))
print("Medium level password. Used for personal use")
print(password)
if 1== "buis":
import random
import string
total = string.ascii_letters + string.digits + string.punctuation
length = 12
password = "".join(random.sample(total, length))
print("high level password used for buisness")
print(password)
Hello there! i am actually trying to make a password maker as googles dosent give those many options… . What I want to do right now is to make it so that the user can choose their password but I am unable to get how… and I am also getting this error:
print("what passwords do you want to use? [please reply with soci, pers or buis for social media, personal or buisness respectively]")
1 == input('please enter')
if 1== "soci":
import random
import string
total = string.ascii_letters
length = 8
password = "".join(random.sample(total, length))
print("Low level password. Commonly used for social media")
print(password)
if 1== "pers":
import random
import string
total = string.ascii_letters + string.digits
length = 10
password = "".join(random.sample(total, length))
print("Medium level password. Used for personal use")
print(password)
if 1== "buis":
import random
import string
total = string.ascii_letters + string.digits + string.punctuation
length = 12
password = "".join(random.sample(total, length))
print("high level password used for buisness")
print(password)
you are not storing the value received from input there, maybe you want to assign the value to the variable instead of checking the value of the variable against user input?
So basically I have made a code which generates passwords from low-level to high-level and I need help looping it so the user can make more passwords again and again
#gives caution
print("⚠️⚠️⚠️Please read the below text⚠️⚠️⚠️")
#asks user which password he wants to use
print("what passwords do you want to use? [please reply with low, mid or high for social media, personal or buisness respectively]")
#asks for the input
userinput = input('please enter')
#social media password
if userinput == "low": #"low" user input
import random #imports of random(to randomise) and string(to group the letters)
import string
total = string.ascii_letters + string.digits #total
length = 8 #determines the length
password = "".join(random.sample(total, length)) #brings it all together
print("Low level password. Commonly used for social media")#prints class
print(password) #prints password
else:
print("INVALID") #Shows that the users code is invalid
#personal use input
if userinput == "mid": #"mid" user input
import random
import string
total = string.ascii_letters + string.digits
length = 10
password = "".join(random.sample(total, length))
print("Medium level password. Used for personal use")
print(password)
else:
print("INVALID")
#buisness input
if userinput == "high": #"high" user input
import random
import string
total = string.ascii_letters + string.digits + string.punctuation
length = 12
password = "".join(random.sample(total, length))
print("high level password used for buisness")
print(password)
else:
print("INVALID")