Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
2.5 kB
0
Indexable
Never
#Import Section
from datetime import date #is to print the date
import getpass #is to print the user name of OS



#Flower Box Section

######################################################################
#
# Name: Kolapo Adegoke
# Date: 6/14/2024
# Program Details: Give a brief description of the code

#######################################################################
#Variable section
usernamelist = []
namedict = {}
usernamelistcopy = []

#Input Section
fname = ["Kolapo","Adegoke","Kestin","Kolapo","Sainab" ]                #Inputing the employees first name 
lname = ["Kolapo","Temidayo","Funso","Florence","Sainab"]              #Inputting the employees last name
yborn = [1997,1998,1997,1999,2000]                                      #Inputting the date of birth of the empolyees

#Process Section
employeelist = list(zip(fname,lname,yborn))               #Inputting the employees first name, last name and date of birth
print(employeelist)                                       #Printing the employees list to able to see how it looks after you run it

for employee in employeelist:                             #Inputting the employees list       
    f_name = employee [0]                                 #Inputting the employees first name with 0
    l_name = employee [1]                                 #Inputting the employees Last name with 1
    y_born = str(employee [2])                            #Inputting the employees date of birth
    #print(f_name[0], l_name, y_born[2:])                  #Printing the name to make sure the codes work
    f_initial = f_name[0].lower()                        #Inputting the name of the employees in lowwercase
    b_year = y_born[2:]                                  #Inputting the date of birth of the employees
    #print(f_initial,b_year,l_name)                   #Printing the names to make sure what we entered is good to go
    username = f_initial+l_name+b_year             #adding the first initial username last name and date of birth
    usernamelist.append(username)
    namedict[username] = employee
    
#print(namedict) 
    
usernameset = set(usernamelist)            #adding the username
#print(usernameset)

usrnamelist = list(usernameset)

for username in usernamelist:
    usernamelistcopy.append(username)
    
print(usernamelistcopy)
    
print(getpass.getuser())                                #in output section print username
print(date.today())                     
Leave a Comment