Write a function called changeLetterCase that takes one string as a parameter and changes all the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a function called changeLetterCase that takes one string as a parameter and changes all the upper case letters to lower case and vice versa. The function returns the updated string with the cases swapped. Task 1: ● if ● Task 2: ● ● Define changeLetterCase function with one string parameter. You can assume that the the arguments of the function will only contain alphabets and will have no numeric values or punctuation Loop through the string to build a new string as described with the cases swapped. Return the new string ● Define the main function with no arguments Assign a string of your choice to a variable. Don't prompt the user for input Call the changeLetterCase function with the variable you created and print the output Call the main function. We will use a special call for the main function which is shown in the pseudocode below: name main () == 11 main ": Sample Input/Output: >> Case-swapped >> Case-swapped output for the string aBcdeFG is ABCDEfg output for the string XYZ is xyz Write a function called changeLetterCase that takes one string as a parameter and changes all the upper case letters to lower case and vice versa. The function returns the updated string with the cases swapped. Task 1: ● if ● Task 2: ● ● Define changeLetterCase function with one string parameter. You can assume that the the arguments of the function will only contain alphabets and will have no numeric values or punctuation Loop through the string to build a new string as described with the cases swapped. Return the new string ● Define the main function with no arguments Assign a string of your choice to a variable. Don't prompt the user for input Call the changeLetterCase function with the variable you created and print the output Call the main function. We will use a special call for the main function which is shown in the pseudocode below: name main () == 11 main ": Sample Input/Output: >> Case-swapped >> Case-swapped output for the string aBcdeFG is ABCDEfg output for the string XYZ is xyz
Expert Answer:
Answer rating: 100% (QA)
Sure heres a Python function called changeLetterCase that swaps the cases of letters in a string and ... View the full answer
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date:
Students also viewed these programming questions
-
What product drove the most ecommerce purchases in October 2022? There was a spike in users on October 12, 2022. Looking at the Google Analytics 4 data, what was the likely cause of this spike in...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
The payroll project that follows is the online version of the same project you completed manually in Chapter 7 of your text. For this project, you will use the Cengage Learning General Ledger to...
-
Give the order of magnitude () for the following algorithm. Explain why your answer is correct. GET VALUES for A1, A2, ..., An, and B, B2, ..., Ba Get value of n /* set i equal to 1 */ /* for each of...
-
Determine the radius of curvature of the path described by the particle of Prob. 11.97 when t = 0.
-
What is a domain name server? What does it do?
-
A political pollster approaches people on the street and asks them to describe their political affiliation. Twenty-eight people describe themselves as Democrats, 25 as Republicans, 8 people provide a...
-
Hetty Grey has just approached a venture capitalist for financing for her new business venture, the development of a local ski hill. On July 1, 2016, Hetty was loaned $150,000 at an annual interest...
-
A light car is purchased on January 1 at a cost of $25,900. It is expected to serve for eight years and have a salvage value of $3,000. It is expected to be used for 96,000 miles over its eight-year...
-
A network consists of the activities in the following list. Times are given in weeks. Activity Preceding A B C D E F -- A A, B C D Time 8 3 7 3 4 9 (a) Draw the network diagram. (b) Calculate the ES,...
-
Crane Company purchased a depreciable asset for $ 1 2 4 0 0 0 0 . The estimated salvage value is $ 6 2 0 0 0 , and the estimated useful life is 1 0 0 0 0 hours. Crane used the asset for 1 1 0 0 hours...
-
11. Which lies outermost in the cranial cavity? A. The dura mater. B. The arachnoid mater. C. The pia mater. D. The subarachnoid space. 12. The brain stem includes the: A. Cerebrum. B. Thalamus. C....
-
1 a) Discuss the various types of agglomeration economies. (6 marks) b) Explain how degree of specialization leads to the growth of urban centers. (4 marks) c) Explain the approaches of determining...
-
a) Find the probability of the number of arrivals (0-5) during i) a 15 minute interval and ii) a 30 minute interval. b) Probability that the system is idle. [3 Marks] [3 Marks] c) Calculate the...
-
Provided below is the activities to be completed in order to accomplish a project. Activities 1-2 Duration in weeks Optimistic time Most likely time Pessimistic time 1 1-3 1-4 2-5 3-5 2 132132 4-6...
-
a) Describe info-gap decision theory citing its three models of decision making under uncertainty. [6 Marks] b) Kerubo is dealing with uncertain income situation. She expect to make Ksh. 20,000 per...
-
Bill is reviewing the firms whose stocks have comprised the DowJones Industrial Average over the years. He discovers Group of answer choices there is an even mix between big and small companies....
-
What is the ideal number of children to have? This question was asked on the Sullivan Statistics Survey I. Draw a dot plot of the variable Children from theSullivanStatsSurveyI data set at...
-
Some people and organizations believe that the discussion of controllable and uncontrollable events is distracting in the sense that it encourages finger-pointing and an excessive preoccupation with...
-
When should an organization use a cash bonus?
-
How can a firm use activity-based costing to help control and reduce environmental costs?
-
Consider expansion of a function in terms of a series \(F_{n}(x)\) in the following form: \[f(x)=\sum_{n} A_{n} F_{n}(x)\] If the functions \(F_{n}\) are orthogonal then this property helps to unfold...
-
A concrete wall \(20 \mathrm{~cm}\) thick is initially at a temperature of \(20^{\circ} \mathrm{C}\), and is exposed to steam at pressure \(1 \mathrm{~atm}\) on both sides. Find the time for the...
-
Analyze the transient problem with the Dirichlet condition for a long cylinder and for a sphere. Derive expressions for the eigenfunctions, eigenconditions, and eigenvalues. Find the series...
Study smarter with the SolutionInn App