Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1 : This lab will have you create and call on functions. Functions are statements that perform a task. They are only executed when
Part :
This lab will have you create and call on functions. Functions are statements that perform a task. They are only executed when they are called upon in the Python program. They can be called once or many times depending what the program needs to do
This program needs to collect pieces of data. What is collected is completely up to you. It just needs to make sense. An example could be collecting name, phone number, email, and address. Each of the items needs to be its own function. You must then call the functions and have the user enter the data. For added complexity, the code needs to ask the user if they are willing to share each item. The user should be able to give just a name, email, phone number, or submit all the data hint: you can use If Statements or any other means Lastly, the data needs to be displayed to the user as a professional readable format. None of the items can show up as undefined or similar, so find a creative way to show no information was entered for that item.
You can save your code as labpy and run it through the python command.
Materials:
Research resources google databases, Lynda.com
Python Editor Notepad Notepad Visual Studio Code
Procedure:
marks
Create code that creates the appropriate variables required define the data you are collecting. Create the or more if needed functions so they can be called upon by your code. Create some additional code to ask the user if they want to enter each piece of information. If they agree, store their information to be recalled at the end of the code. Run that process for all or more functions you created and finally display the inputted data back to the user in a professional and readable format. Remember, you must create a placeholder for data not collected. Undefined or simular is considered unacceptable. For this lab we are focused on functions and data collection. We will not worry about data validation at this point to prevent GIGO
Your Code:
Copy and paste your code here.
Questions:
Why would functions be a benefit to a software writer? Provide an example of some code that would be best used as a function. Dont write the code, just describe it marks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started