There are several deliverables for this assignment. Please submit the following files to zyBooks: small_functions.py Activity...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
There are several deliverables for this assignment. Please submit the following files to zyBooks: small_functions.py Activity #1: Small functions-individual This activity is meant to give you more experience writing functions. Name your file small_functions.py and include all of the following parts in one file. For all parts, include the function named as specified in your submission. Your program does NOT have to include output, however you should test your functions. For example, you might include several function calls and print the results. You may make multiple functions within any one of these problems as long as the main function is named accordingly. Please comment out ALL input () statements before submitting. a) Imagine that you have a spherical bead. In other words, a sphere with a cylindrical hole drilled through the middle: Write a function named parta that will take in as parameters the radius of the sphere and the radius of the hole, and return the volume of the bead. b) Write a function named partb that will take in as a parameter a positive integer n and determines if n can be calculated as the sum of 2 or more consecutive positive, odd integers. If it can, return a list of the numbers, otherwise return False. c) Write a function named partc that will take in as parameters a single character, a person's name, company, and email, and returns a single string of the person's digital business card. Use the character as a border, and provide 2 spaces as padding on either side of the longest entry. Your function must return a single string, do NOT print the digital card. Example using parameters (***, Dr. Ritchey', 'Texas A&M University', 'snritchey@tamu.edu"): Dr. Ritchey Texas A&M University anritchey@tamu.edu d) Write a function named partd that takes in as a parameter one list of numbers and returns the minimum, median, and maximum value of the list, in that order. Lab: Topic 9 (individual) e) Write a function named parte that takes in as parameters two parallel lists: a list of times (in increasing order), and a list of distances traveled by that point in time. The function should return a new list giving the velocity between consecutive time measurements. The new list should have a length of one less than the original lists. f) Write a function named partf that takes in as a parameter one list of numbers and determines if two of the numbers in the list add to 2026. If they do, return the product of the two numbers, otherwise return False. There are several deliverables for this assignment. Please submit the following files to zyBooks: small_functions.py Activity #1: Small functions-individual This activity is meant to give you more experience writing functions. Name your file small_functions.py and include all of the following parts in one file. For all parts, include the function named as specified in your submission. Your program does NOT have to include output, however you should test your functions. For example, you might include several function calls and print the results. You may make multiple functions within any one of these problems as long as the main function is named accordingly. Please comment out ALL input () statements before submitting. a) Imagine that you have a spherical bead. In other words, a sphere with a cylindrical hole drilled through the middle: Write a function named parta that will take in as parameters the radius of the sphere and the radius of the hole, and return the volume of the bead. b) Write a function named partb that will take in as a parameter a positive integer n and determines if n can be calculated as the sum of 2 or more consecutive positive, odd integers. If it can, return a list of the numbers, otherwise return False. c) Write a function named partc that will take in as parameters a single character, a person's name, company, and email, and returns a single string of the person's digital business card. Use the character as a border, and provide 2 spaces as padding on either side of the longest entry. Your function must return a single string, do NOT print the digital card. Example using parameters (***, Dr. Ritchey', 'Texas A&M University', 'snritchey@tamu.edu"): Dr. Ritchey Texas A&M University anritchey@tamu.edu d) Write a function named partd that takes in as a parameter one list of numbers and returns the minimum, median, and maximum value of the list, in that order. Lab: Topic 9 (individual) e) Write a function named parte that takes in as parameters two parallel lists: a list of times (in increasing order), and a list of distances traveled by that point in time. The function should return a new list giving the velocity between consecutive time measurements. The new list should have a length of one less than the original lists. f) Write a function named partf that takes in as a parameter one list of numbers and determines if two of the numbers in the list add to 2026. If they do, return the product of the two numbers, otherwise return False.
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
QUESTION 2 A non-symmetrical rigid jointed portal frame ABCD is fixed at A and D. It carries a trapezoidal distributed load acts along beam BC as illustrated in Figure Q2. The frame was constructed...
-
A new low fat fudge bar is advertised as having 120 calories; the manufacturing company conducts regular checks by selecting independent random samples and testing the sample average against the...
-
Javier is retiring from the JKL Partnership. In January of the current year, he has a $100,000 basis in his partnership interest when he receives a $10,000 cash distribution. The partnership plans to...
-
Suppose that the firm of Example 17.6 has a value of \(\$ 200,000\) instead of \(\$ 100,000\). Perhaps this makes the bond more secure. What, in fact, is the value of the bond in this case? Example...
-
Given the following diagram, a. What is the capacity of this system? b. If the capacity of one operation could be increased in order to increase the output of the system, which operation should it...
-
(1) Using 3 half-adders, implement the following functions: 1) D=ABOC 2) A'BC + AB'C 3) ABC' + (A'+B')C 4) G = ABC
-
c. Suppose the CFO wants you to do a scenario analysis with different values for the cost savings, the machine's salvage value, and the net operating working capital (NOWC) requirement. She asks you...
-
Go to http://www.federalreserve.gov/releases/h6/hist/ and find the historical report of M1 and M2 by clicking on the Data Download Program. Compute the growth rate of each aggregate over each of the...
-
Global Technology is based in the USA and prepares its financial statements in dollars. On December 5, 20X5, Global had two sales transactions with customers in Europe. The first transaction was for...
-
Go to the World Banks databank website at http://databank.worldbank.org/data/reports. aspx?source=2&country=. Find the following annual data for Argentina, for the past 25 years: (i) GDP at current...
-
Go to https://www.federalreserve.gov/monetarypolicy/fomc.htm. This site reports activity by the FOMC. Click on Meeting calendars and information and click on the statement released after the most...
-
Consider a representative agent economy where the representative agent's utility function is given by \(\mathbf{u}(x)=\log (x)\) and the aggregate endowment process is \(e=\left\{e_{0}, e\left(A_{t}...
-
An insulated piston-cylinder device contains 5 L of saturated liquid water at a constant pressure of 150 kPa. An electric resistance heater inside the cylinder is now turned on, and 2200 kJ of energy...
-
For a nonzero constant a, find the intercepts of the graph of (x 2 + y 2 ) 2 = a 2 (x 2 - y 2 ). Then test for symmetry with respect to the x-axis, the y-axis, and the origin.
-
Frank, age 35, and Joyce, age 34, are married and file a joint income tax return for 2012. Their salaries for the year total $83,000 and they have taxable interest income of $4,000. They have no...
-
Yolanda is a cash basis taxpayer with the following transactions during the year: Cash received from sales of products........................................................................$65,000...
-
Joan is a self-employed attorney in New York City. Joan took a trip to San Diego, CA, primarily for business, to consult with a client and take a short vacation. On the trip, Joan incurred the...
-
Many factors affect the economics of sport. What are some not discussed in the chapter? How do they affect financial management within the industry?
-
What is financial management? How does financial management differ in the sport industry as compared to other industries?
-
Which has the greater impact on financial management: the structure of a league or the structure of a team?
Study smarter with the SolutionInn App