Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please need help to to reorganize your functions into modules and produce documentation (using Pydoc) for your work using the principles. I have the code

Please need help to to reorganize your functions into modules and produce documentation (using Pydoc) for your work using the principles. I have the code just need to reorganize in to modules and documentations like

""" Processes a list of numbers, and divides one number by the other

Arguements:

passed_list [list of dictionaries]-- each dictionary has th eformat of {top_number: int, bottom_number: int}

Returns:

a list of values obtained when we divide top_number for each dictionary

"""

for every functions and do py . please do in visual studio code and attach the screenshots with the output Thank you

# putting emplyee ID in a fuction

def getID():

id_ok = False

while not id_ok:

employee_ID = input("Enter employee_ID: ")

id_ok = isIDOK(employee_ID)

return employee_ID

#validating the employee id

def isIDOK(passed_employee_ID):

if len(passed_employee_ID) <= 7 and passed_employee_ID.isdigit():

return True

else:

print("This is inputted improperly. Please try again")

return False

# putting emplyee name in a fuction

def getName():

name_ok = False

while not name_ok:

employee_name = input("Enter employee name: ")

name_ok = isNameOK(employee_name)

return employee_name

#validating employee name

def isNameOK(passed_employee_name):

bad_chars = ["!", '"', "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", ",", "<", ">", "/", "?",

";", ":", "[", "]", "{", "}", "\\", "."]

if passed_employee_name:

for character in passed_employee_name:

if character in bad_chars or character.isdigit():

print("Employee name is incorrect. Please try again.")

return False

return True

else:

print("Employee name is missing. Please try again.")

return False

# putting employee email in a function

def getEmailAddress():

email_ok = False

while not email_ok:

employee_email = input("Enter employee email:")

email_ok = isEmailOK(employee_email)

return employee_email

# Validating employee email

def isEmailOK(passed_employee_email):

bad_chars = ["!", '"', "#", "$", "%", "^", "&", "*", "(", ")", "=", "+", ",", "<", ">", "/", "?",

";", ":", "[", "]", "{", "}", "\\"]

if passed_employee_email:

bad_chars_found = False

for character in passed_employee_email:

if character in bad_chars or character.isdigit():

bad_chars_found = True

if bad_chars_found:

print("Employee email is incorrect. Please try again")

return False

return True

else:

print("Employee email is missing. Please try again.")

return False

#putting employee address in a fuction

def getAddress():

address_ok = False

while not address_ok:

employee_address = input("Enter employee address:")

address_ok = isEmailOK(employee_address)

return employee_address

# Validating employee address

def isAddressOK(passed_employee_address):

bad_chars = ["!", '"', "@", "#", "$", "%", "^", "&", "*", "(", ")", "=", "+", ",", "<", ">", "/", "?",

";", ":", "[", "]", "{", "}", "\\", "."]

if passed_employee_address:

bad_chars_found = False

for character in passed_employee_address:

if character in bad_chars or character.isdigit():

bad_chars_found = True

if bad_chars_found:

print("Employee address is incorrect. Please try again")

return False

return True

else:

print("Employee address is missing. Please try again.")

return False

#putting the information in alist

employee_list = []

# Loop and getting data for 5 employees

while len(employee_list) <= 5:

temp_id = getID()

temp_name = getName()

temp_email = getEmailAddress()

temp_addrss = getAddress()

employee_list.append({"employee_id": temp_id, "employee_name": temp_name, "E-mail": temp_email, "Address": temp_addrss})

stop = input(" Do you want to quit? Y/N:")

if stop == 'y' or stop == 'Y':

for employee in employee_list:

print("Your Employee ID is " + employee["employee_id"] + "." + "Hello," + employee["employee_name"] + "." +

" Your email address is " + employee["E-mail"] + " address is "+ employee["Address"])

print(employee_list) #print the employee list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions