Untitled
unknown
plain_text
a year ago
2.5 kB
7
Indexable
#import section
from datetime import date
import getpass
######################################################################
#
# Name: Kolapo Adegoke
# Date: 6/20/2024
# Program Details: Give a brief description of the code
#######################################################################
#Input Section
fname = '' #inputting my first name
lname = '' #input my last name
yborn = '' #input my date of birth
employeelist = []
ylist = ["Yes","Y", "y", "yes", "YES"]
while len(employeelist) < 5:
fname = input("Enter your First Name: ")
while len(fname) < 2:
fname = input("Enter your First Name (Minimum 2 Characters): ")
lname = input("Enter your Last Name: ")
while len(lname) < 2:
fname = input("Enter your Last Name (Minimum 2 Characters): ")
yborn = input("Enter your 4 digit Birth Year: ")
while len(yborn) != 4:
yborn = input ("Enter your Birth Year (Has to be 4 digits): ")
print("you entered +", fname, lname, yborn)
print("is this correct: If it is correct please enter Yes, if not NO")
confirm = input()
if (confirm in ylist):
employee_data =(fname, lname, yborn)
employeelist.append(employee_data)
fname = ''
lname = ''
yborn = ''
else:
fname = ''
lname = ''
yborn = ''
continue
#Process section
employee_data_dict ={}
for i, employee_info in enumerate(employees_data): #Input & Store username in a dictionary with the employee information
username = generate_username (*employee_info, username_list)
employee_data_dict[username] = employee_info
#Output section
today_date = datetime.today().strftime ('%y-%m-%d') #input the date and time of the employees
print('\nOutput:"') #Input to know if the code works
print(f"Username: {', '.join(username_list)}") #Input the username and list
print (f"Employee Data list: {employees_data}") #Input the employees data
Print(f"Today's Date: {today_date}") #Input today's date
Print(f"Employee Data Dictionary: {employee_data_dict}") #Inout employees data in dictionary
sorted_username_list = sorted(username_list) #Sorting the username
print(f"sorted username list: {sorted_username_list}")
Editor is loading...
Leave a Comment