-
-
Save codecademydev/9155540c48f61072835298c4fa7ca16a to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def username_generator(first_name,last_name): | |
username = first_name[:3] + last_name[:4] | |
if len(first_name) < 3 or len(last_name) < 4: | |
username1 = first_name + last_name | |
return username1 | |
return username | |
def password_generator(username): | |
password = "" | |
for i in range(0, len(username)): | |
password += username[i-1] | |
return password | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for the username_generator function, consider if we first_name = "Jo" and last_name = "Christian" the output should be JoChri
but your code will give JoChristian
can you figure out what is wrong with your code?
See how I fix it below: