a) Create a file userFunctions.py: 2. Modify nameFormat() to accept only two parameters first and last. Change last to a

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

a) Create a file userFunctions.py: 2. Modify nameFormat() to accept only two parameters first and last. Change last to a

Post by answerhappygod »

a) Create a file userFunctions.py:
2. Modify nameFormat() to accept only two parameters first and last. Change last to an optional parameter.
This
function should now return either first or last. first.
3. Define a function printUsers() which accepts a list parameter users. This function calls the printUser() function
to print all user data.
b) Create a separate file, functionModule.py:
Import all functions from userFunctions.py.
2. In this file create a list users.
• Use nameFormat() and createUser() to add dictionaries to the list users:
John smith, age 42, job Programmer, hobby Biking
tom cat, age 24, job Security Analyst
jerry mouse, age 25, job DevOps Engineer, hobby Running
sara, age 20, school QCC, major CSIS
4. Use the print Users) function to print all list users.
A Create A File Userfunctions Py 2 Modify Nameformat To Accept Only Two Parameters First And Last Change Last To A 1
A Create A File Userfunctions Py 2 Modify Nameformat To Accept Only Two Parameters First And Last Change Last To A 1 (46.64 KiB) Viewed 34 times
A Create A File Userfunctions Py 2 Modify Nameformat To Accept Only Two Parameters First And Last Change Last To A 2
A Create A File Userfunctions Py 2 Modify Nameformat To Accept Only Two Parameters First And Last Change Last To A 2 (42.13 KiB) Viewed 34 times
A Create A File Userfunctions Py 2 Modify Nameformat To Accept Only Two Parameters First And Last Change Last To A 3
A Create A File Userfunctions Py 2 Modify Nameformat To Accept Only Two Parameters First And Last Change Last To A 3 (42.1 KiB) Viewed 34 times
In Python, please and thank you
Problem 1 - Implementing Modules (4 pts) a) Create a file user Functions.py: 1. Copy nameFormat(), createUsero, and printUser from PE 10 into the userFunctions.py file. 2. Modify nameFormat) to accept only two parameters first and last. Change last to an optional parameter. This function should now return either first or last, first. 3. Define a function printUsers() which accepts a list parameter users. This function calls the printUser() function to print all user data. b) Create a separate file, function Module.py: 1. Import all functions from userFunctions.py. 2. In this file create a list users. 3. Use name Format() and createUser() to add dictionaries to the list users: John smith, age 42, job Programmer, hobby Biking tom cat, age 24.job Security Analyst jerry mouse, age 25. job DevOps Engineer, hobby Running sara, age 20, school QCC, major CSIS 4. Use the printUsers() function to print all list users. Example Output name: Smith, John age: 42 job: Programmer hobby: Biking name: Cat, Tom age: 24 job: Security Analyst name: Mouse, Jerry age: 25 job: DevOps Engineer hobby: Running name: Sara age: 20 school: QCC major: CSIS

Data Management Functions 2. Name format a) Define a function nameFormar() with parameters first, middle, and last. 1) This function prints the first name, the middle initial and the last name using proper title format. b) Define a main() function to do the following: 1) Call the function nameFormat with these positional arguments: john stu smith 2) Call the function name Format with these keyword arguments: last = 'kennedy, first = "john', middle = 'fitzgerald c) Call main() function to initiate the tasks to be performed. Example Output John s. Smith John F. Kennedy 3. Name format a) Define a function name Format() with parameter first, last and middle where middle is an optional parameter. If all three names are provided return: Last, First, M. If only first and last are provided return: Last, First b) Define a main() function to do the following: 1) Call the function with keyword arguments for the name: james bond 2) Call the function with keyword arguments for the name: henry indiana jones 3) Print the results of the function calls. c) Call main() function to initiate the tasks to be performed. Example Output Bond, James Jones, Henry, I.

Data Management Functions 2. Name format a) Define a function nameFormar() with parameters first, middle, and last. 1) This function prints the first name, the middle initial and the last name using proper title format. b) Define a main() function to do the following: 1) Call the function nameFormat with these positional arguments: john stu smith 2) Call the function name Format with these keyword arguments: last = 'kennedy', first = "john', middle = 'fitzgerald c) Call main() function to initiate the tasks to be performed. Example Output John s. Smith John F. Kennedy 3. Name format a) Define a function name Format() with parameter first, last and middle where middle is an optional parameter, If all three names are provided return: Last, First, M. If only first and last are provided return: Last, First b) Define a main() function to do the following: 1) Call the function with keyword arguments for the name: james bond 2) Call the function with keyword arguments for the name: henry indiana Jones 3) Print the results of the function calls. c) Call main() function to initiate the tasks to be performed. Example Output Bond, James Jones, Henry, I.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply