Username

Given a first and last name, we normalize the names to lowercase and create an 8-letter username using the first character of the first name and the first 7 characters of the last name.

In [2]:
def uname():
    first = input("Please enter your first name: ")
    last = input("Please enter your last name: ")
    uname = first[0] + last[:7]
    print(uname)
In [3]:
uname()
Please enter your first name: Richard
Please enter your last name: Sarkis
RSarkis
In [4]:
def uname2():
    first = input("Please enter your first name: ")
    last = input("Please enter your last name: ")
    
    first = first.lower()
    last = last.lower()
    
    uname = first[0] + last[:7]
    print(uname)
In [5]:
uname2()
Please enter your first name: Richard
Please enter your last name: Sarkis
rsarkis
In [6]:
uname2()
Please enter your first name: Donna
Please enter your last name: Rostenkowski
drostenk