questions is what im looking help with, the others are for context. In Python please and Thank you
Problem 1 - Implementing Modules (4 pts) a) Create a file user Functions.py: 1. Copy nameFormato createUsero, and printUser) from PE 10 into the user Functions.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.
5. Dictionary a) Define a function createUser() with an arbitrary dictionary parameter. This function returns a dictionary based upon input arguments. b) Define a function printUser() with a parameter user which is a dictionary. This function prints the contents of the dictionary user. c) Create and print the user: John, age 43,job Programmer, Hobby Biking d) Create and print the user: Sara, age 20, school QCC, major CSIS Example Output name: John age: 43 job: Programmer hobby: Biking name: Sara age: 24 school: QCC major: CSIS
The first Problem 1 - Implementing Modules (4 pts) a) Create a file user Functions.py: 1. Copy nameFormato createUsero, and printU
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am