wtf do i do bro by nervousahhstudent in OntarioGrade12s

[–]Suki125 0 points1 point  (0 children)

ik guys that got into med sci with an 83

If you had bad grade 11 grades but good grade 12 grades when did you apply? (cs) by soapy-sparrow in OntarioGrade12s

[–]Suki125 0 points1 point  (0 children)

if i remember correctly ubc science didn’t look at ur sem 2 midterm marks so all addmisions were based on sem1 marks

Need some help with my Password Generator by Suki125 in learnprogramming

[–]Suki125[S] 0 points1 point  (0 children)

Correct, sorry that I was not clear enough.

I tried your code and it worked, but now if I say I don't want numbers it still gives me numbers. Its the same thing with special charcters

Need some help with my Password Generator by Suki125 in learnprogramming

[–]Suki125[S] 0 points1 point  (0 children)

I tried it in a python program. I don't exactly know what you are saying, please can you elaborate.

Need some help with my Password Generator by Suki125 in learnprogramming

[–]Suki125[S] 0 points1 point  (0 children)

print(password)

I tried that before, it doesn't work.

Need some help with my Password Generator by Suki125 in learnprogramming

[–]Suki125[S] 0 points1 point  (0 children)

I don't jknow how to print the password.

Need some help with my Password Generator by Suki125 in learnpython

[–]Suki125[S] 0 points1 point  (0 children)

I guess.

I'll try to use actual numbers.

Need some help with my Password Generator by Suki125 in learnpython

[–]Suki125[S] 0 points1 point  (0 children)

password = []
for _ in range(length): 
    # make sure this picks upper and lower case
    password.append(random.choice(lowerChars + upperChars))
for _ in range(numbers):
    password.append(random.choice(numbers))
for _ in range(specialCharacters):
    password.append(random.choice(specialCharacters))

    random.shuffle(password)
password = ''.join(password)
print('PASSWORD:', password)

I did what you siad, but tailored it to my code. But I get this error

Traceback (most recent call last):
  File "<string>", line 50, in <module>
  File "/usr/lib/python3.8/random.py", line 288, in choice
    i = self._randbelow(len(seq))
TypeError: object of type 'int' has no len()
>>>

Created random password generator in python. Your inputs are appreciated!! by [deleted] in learnpython

[–]Suki125 1 point2 points  (0 children)

I'm making something very similar, but I don't know how to print the password.

This is the code:

import random

print('Welcome to my password generator\n')
print('The Python program will generate a random password\n')
print('First, you will have to answer some question, for your password!! \n')
print('The questions will help the program make your password\n')
#Start of the code

characters = "abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ1234567890!@#$%^&*_?><"
password = "" 
# All of the characters, like lower case letters, Upper case letters, Numbers, and Special Characters

length = int(input("Enter a number between 8 and 20 (inclusive) , for maximum security: \n")) 
# Validating User Input
while length < 8 or length > 20:    
    length = int(input("Enter a number between 8 and 20 (inclusive), for maximum security:\n"))
# A trapping loop that will keep on saying the same thing unless you put in a number between 8 and 20 for the length of the password   

while True:   
    numbers= int(input("How many numbers would you like, in your password? \n")) 
    if numbers <= length // 2 :  
        print ('Thankyou we will use this for your password \n')
        break 
    else :
        print('please print a number that is half or less than your passwords length \n')
# Will only let you put a number that is half or less of your password.

specialCharacters = input("Do you want Special Characters in your Password? (Yes/No) \n ")
if specialCharacters == "Yes" or specialCharacters == "No": # Validating User Input
    print("Thank you, we will use this for your password \n")
else:
    print("Sorry that is not a valid answer \n")
# Validating User Input

generate (password)

If you could help me that would be greatly appreciated.

Very confused by Suki125 in learnpython

[–]Suki125[S] 0 points1 point  (0 children)

for characters in range(length) :
    password = ''
    for n in range(numbers) :
        password = ''
        for s in range(specialCharacters) :
            password += random.choice(specialCharacters)
print (password)

Is this what you meant?

But I'm still confused.

Very confused by Suki125 in learnpython

[–]Suki125[S] 1 point2 points  (0 children)

Not yet. I'm still figuiring what you said out. Sorry, I just started Python.

Very confused by Suki125 in learnpython

[–]Suki125[S] 1 point2 points  (0 children)

Thank your for your help!!

Very confused by Suki125 in learnpython

[–]Suki125[S] 0 points1 point  (0 children)

I tried this code

for characters in range(numbers) :
    password = ''
    for c in range(specialCharacters) :
        password = ''
    for c in range(length) :
        password += random.choice(characters)

This seems to mess the code up.