One (1) function to capture user input for each word needed to complete the MadLib, See below
Question:
One (1) function to capture user input for each word needed to complete the MadLib, See below for words needed and encourage the user to enter upper, lower, and mixed-case answers.
Three (3) functions to print each line of the Madlib, with values passed into each function in order to fill in the blanks as described below
A function called main to call the others
Use variables where needed. Name the variables appropriately.
Note: Use the appropriate string method from the Python Library.
Use the following story: (The highlighted words must be replaced with the input values in the format specified)
"Say food!", the photographer said as the camera flashed. name capitalized and I had gone to a place capitalized to get our photos taken on my birthday.
The first photo we really wanted was a picture of us dressed as animals uppercase pretending to be a professional uppercase.
When we saw the second photo, it was exactly what I wanted. We both looked like things lowercase wearing clothing
lowercase and another verb swap case!
Hint:
There are two ways you can approach the issue of retrieving the values of the variables in the function thats handles the input
1. use the global keyword for each variable that has values obtained via user input.
2. return multiple values back to the line in the main function that calls the input values function. A function in Python can return multiple values - as a comma separated list
2. Create a Python program by providing an appropriate name for the file
Accept an integer from the user. Assume it's a 4 digit number. The 4 digit number input can be either positive or negative.
Use the available arithmetic operators to store the result in 4 variables. Name the variables as follows:
- ones
- tens
- hundreds
- thousands
Your final output must be in the following form:
The quotient when
The remainder when
Please test your script for multiple input values to ensure you are getting the correct results
Example execution
Input a number: 6803
Using the appropriate arithmetic operators, the result is stored as follows:
ones = 3
tens = 0
hundreds = 8
thousands = 6
Final output
The quotient when 6803 is divided by 17 is 400.
The remainder when 6803 is divided by 17 is 3.
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill