First time post the topic, if there any mistake please forgive me,
when i was doing the strings last chapter, i found that my coding is different with the solution but look like is still pass and get the instructions target, but not sure which one will be better!!
this is my code:
def username_generator(first_name, last_name):
if len(first_name) >= 3 or len(last_name) >= 4:
username = first_name[:3] + last_name[:4]
if len(first_name) < 3 or len(last_name) < 4:
username = first_name + last_name
return username
first_name = "amao"
last_name = "choue"
test = username_generator(first_name, last_name)
print(test)
def password_generator(user_name):
password = user_name[-1] + user_name[:-1]
return password
user_name = "amaochou"
test1 = password_generator(user_name)
print(test1)
Also my first language isnt English, not sure could totally understand my questiuon.
You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. loops, learn-compatibility
When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!
If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer!