Write a Python function that gets a string as parameter and (a) adds 'ing' at the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Python function that gets a string as parameter and (a) adds 'ing' at the end of the given string, (b) if the given string already ends with 'ing' then add 'ly' instead. If the length of the given string is less than 3, it is unchanged. Note: Your solution must handle different case types (both uppercase and lowercase characters). Write Python statements that reads a string, calls the method and prints the result. Part-3: Please enter a string: test The output of the function is: testing Please enter a string: TESTING The output of the function is: TESTINGLY Please enter a string: Go The output of the function is: Go Write a Python function that gets a string as parameter and (a) adds 'ing' at the end of the given string, (b) if the given string already ends with 'ing' then add 'ly' instead. If the length of the given string is less than 3, it is unchanged. Note: Your solution must handle different case types (both uppercase and lowercase characters). Write Python statements that reads a string, calls the method and prints the result. Part-3: Please enter a string: test The output of the function is: testing Please enter a string: TESTING The output of the function is: TESTINGLY Please enter a string: Go The output of the function is: Go Write a Python function that gets a string as parameter and (a) adds 'ing' at the end of the given string, (b) if the given string already ends with 'ing' then add 'ly' instead. If the length of the given string is less than 3, it is unchanged. Note: Your solution must handle different case types (both uppercase and lowercase characters). Write Python statements that reads a string, calls the method and prints the result. Part-3: Please enter a string: test The output of the function is: testing Please enter a string: TESTING The output of the function is: TESTINGLY Please enter a string: Go The output of the function is: Go Write a Python function that gets a string as parameter and (a) adds 'ing' at the end of the given string, (b) if the given string already ends with 'ing' then add 'ly' instead. If the length of the given string is less than 3, it is unchanged. Note: Your solution must handle different case types (both uppercase and lowercase characters). Write Python statements that reads a string, calls the method and prints the result. Part-3: Please enter a string: test The output of the function is: testing Please enter a string: TESTING The output of the function is: TESTINGLY Please enter a string: Go The output of the function is: Go
Expert Answer:
Answer rating: 100% (QA)
Heres a Python function that fulfills the requirement python def manip... View the full answer
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these computer network questions
-
Ganymede is a large moon of Jupiter. You see it here in the foreground of this image. I've given you two of the orbital parameters that you will need for this problem below. Be sure to convert your...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
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...
-
The _____________ works out the best way to structure finances and make effective financial decisions.
-
Keenan Co. is expected to maintain a constant 5.2 percent growth rate in its dividends indefinitely. If the company has a dividend yield of 6.3 percent, what is the required return on the company's...
-
At many companies, management identifies and tests what it describes as key or significant controls as a part of its assessment of internal control over financial reporting. Is the auditor required...
-
It was mentioned in the chapter that KPMG has reorganized itself around five national industry-focused teams that consist of assurance, tax, and consulting professionals concentrating on each...
-
The following inventory data relate to Edwards, Inc.: Calculate the following for the year: a. Direct materials purchased. b. Direct labor costs incurred. c. Cost of goods sold. d. Gross profit....
-
Learning Outcomes Assessed: Write product descriptions based on the products physical and functional features following technical writing standards and using appropriate vocabulary and grammar....
-
How would the Highest interest rate to the Lowest credit card payment method apply a $1200 payment to a card with an outstanding balance of $2000 broken down as follows: Transaction Rate Balance...
-
The City of Dover needs land owned by the Smith family to expand Route 13/North DuPont Highway. The Smith family does not want to sell. Discuss what course of action the city can take and the legal...
-
A friend of yours owns a shop selling CDs and posters for the 12- to 14-year-old market. From the following information advise him on the potential problems that may be encountered in the valuation...
-
Tartantrips Ltd, a company in Scotland, operates several ferries and has a policy of holding several in reserve, due to the weather patterns and conditions of various contracts with local...
-
Describe the ways in which both the direct method and the indirect method may be used by a business to derive cash generated from operations during an accounting period.
-
(i) Which cash analysis is used to link the statement of cash fl ows to the balance sheet? (ii) What are the links?
-
Forget your income statements and balance sheets, at the end of the day its the businesss healthy bank balance that is the measure of its increase in wealth. Discuss.
-
Required information PA5-3 (Algo) Identifying Outstanding Checks and Deposits in Transit and Preparing a Bank Reconciliation and Journal Entries [LO 5-4, LO 5-5] [The following information applies to...
-
$10,000 was borrowed at 3.5% on July 17. The borrower repaid $5000 on August 12, and $2000 on September 18. What final payment is required on November 12 to fully repay the loan?
-
Regulating Market Power in the Commons: In exercises 21.9 and 21.10, we investigated the case of many firms emitting pollution into a lake. We assumed the only impact of this pollution was to raise...
-
I hate grits so much that the very idea of owning grits makes me sick. I do, on the other hand, enjoy a good breakfast of Coco Puffs Cereal. A: In each of the following, put boxes of grits on the...
-
Syllabi-Induced Tastes over Exam Grades: Suppose you are taking two classes, economics and physics. In both classes, only two exams are given during the semester. A: Since economists are nice people,...
-
What does a high net wells to gross wells ratio indicate?
-
What is the value added ratio? What does a high (low) value added ratio indicate?
-
What does a low average reserves per well ratio indicate?
Study smarter with the SolutionInn App