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)