Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a script that creates users based on following names: Username is the firs

ID: 3778081 • Letter: W

Question

Write a script that creates users based on following names: Username is the first letter of first name and first 7 letters of last name: total 8 letters Example: David Khan rightarrow dkhan Wayne Rothwell rightarrow wrothwel If you see the duplicate names, John Doe righttarrow jdoe Jane Doe rightarrow jadoe john Doe rightarrow jodoe names4accounting. list Wayne Rothwell Fatima Scoggin Isabell Asaro Shondra Rosinski Alix Nembhard Marjory Case Tamra Buckles Chara Ruffo Davida Olmos Madlyn Cost Eliza Kober

Explanation / Answer

def username(lst, name):
    name = name.split(" ")
    name[0] = name[0].lower()
    name[1] = name[1].lower()
    uname = name[0][0] + name[1][0:7]
    if uname in lst:
        uname = name[0][0:2] + name[1][0:7]
    return uname

names4accounting = ["Wayne Rothwell", "Fatima Scoggin", "Isabell Asaro", "Shondra Rosinski", "Alix Nembhard", "Marjory Case", "Tamra Buckles", "Chara Ruffo", "Davida Olmos", "Madlyn Cost", "Eliza Kober"]
uname_list = []
for name in names4accounting:
    uname_list.append(username(uname_list, name))
print uname_list

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote