+ 1

Attempting a simple password generator`

I'm learning some string methods, and trying to apply them . i came up with a simple password generator, it runs but im having trouble with the output. any help appreciated(with a mini explanation please) import random #this prints a introductory message print("We are going to be generating a password from your name and surname") #our inputs name = input("Please enter your name: ") surname = input("Please input your surname: ") #our function that should take our inputs, slice them and return a password def password_gen(name, surname): #these are our characters that will be selected for our 6 digit password char1 = name[0] char2 = name[2] char3 = surname[0] char4 = surname[2] char5 = surname[4] char6 = len(name+surname) password = char1 + char2 + char3 + char4 + char5 + str(char6) return password print(password_gen)

31st Mar 2021, 2:00 PM
Chad
Chad - avatar
4 odpowiedzi
+ 5
I have just made few changes in ur code May be this will help you: https://code.sololearn.com/cOg3IcJQGqID/?ref=app
31st Mar 2021, 2:21 PM
Kǟrɨsɦmǟ ❥
Kǟrɨsɦmǟ ❥ - avatar
+ 5
You're welcome 🤗
31st Mar 2021, 2:35 PM
Kǟrɨsɦmǟ ❥
Kǟrɨsɦmǟ ❥ - avatar
31st Mar 2021, 2:20 PM
DOJ
DOJ - avatar
+ 1
Thanks Karishma, now I see where my issue is, when I call the function I must call the arguments as well. You are amazing thank uuuuuuuuuuuuuu
31st Mar 2021, 2:34 PM
Chad
Chad - avatar