
35.3 Lecture 19-Apr-Q3
Suppose you are given a function in module foo named loop_string_reverse to reverse a string using loops that accepts the original string and returns the reversed string. But the numbers in the string are ignored. for eg, If the user input is he2ll8o will resolve to hello after removing the numbers 2 and 8 which will produce olleh as the reverse string output
Now define a function loop_string_reverse_all that accepts a list of user entries and applies the method loop_string_reverse`` in modulefoo``` to each of them, and returns a new list of reverse strings.
If function accepts the list input ['ab2ji89','6hel', 'ol5f'] then the function call returns the list ['ijba', 'leh ', 'flo']
Please answer in Python thank you
![35.4 Lecture 19-Apr-Q4
Suppose you are given a function in module foo named `function loop_string_reverse_all that accepts a list of user entries and
applies the method loop_string_reverse in modulefooto each of them, and returns a new list of reverse strings
that doesn't include numbers. For eg, if function accepts the list input[ab2ji89',6hel', 'ol5f]then the function call
returns the list[ijba', 'leh ', 'flo]*
Now ask the user to accept strings until user enters quit and display a list of reversed strings. If user enters
ab2ji89
6hel
o15f
quit
output is
['ijba', 'leh', 'flo']
You can use the function loop_string_reverse_all in module foo to solve this.
376584.2127280.qx3zay7](https://content.bartleby.com/qna-images/question/35a6a7ab-6f7e-4dff-9510-82f9c5d6fb4f/5fd0a38e-8b60-4cc9-b8ea-592ee65486a7/ll9sr8d_thumbnail.png)

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

How do I prevent "quit" from being reversed and appended to the new list?
How do I prevent "quit" from being reversed and appended to the new list?
- in python plsarrow_forwardDefine a function named check_game_finished (encrypted_list) which takes a list of characters as a parameter. The function returns True if the game is over, and False otherwise. The game is over when there is no longer any "*" characters in the parameter list. For example: Test Result False True data = ['h', '*', ¹*¹, ¹*¹, ¹*'] print(check_game_finished (data)) data = ['h', 'e', '1', '1', 'o'] print(check_game_finished(data)) data = ['s', ¹*¹ 'd'] False print(check_game_finished (data))arrow_forwardWrite a function called reverse that takes a parameter N which is a string and returns the reverse of the string.arrow_forward
- The following requirments that weren't mentioned for solving the following Python Code below: The provided code for alphabet, test_dups, test_miss, and histogram. Your implementation of the has_duplicates function. A loop that outputs duplicate information for each string in test_dups. Your implementation of the missing_letters function. A loop that outputs missing letters for each string in test_miss. Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alphabet that are not in the argument string. The letters in the returned string should be in alphabetical order. Your implementation should use a histogram from the histogram function. It should also use the global variable alphabet. It should use this global variable directly, not through an argument or a local copy. It should loop over the letters in alphabet to determine which are missing from the input parameter. The function missing_letters should…arrow_forwardWrite a C++ function named dup that makes a copy of a user input C-string and repeats the C-string. For example, if the user inputs "HelloWorld" then it will say "HelloWorldHelloWorld" Dynamically allocate memory *(using new)* for a new C-string large enough to hold the result C-string. It should be the minimum size necessary to store the result C-string. Don't forget room for a null character! Put the result C-string into the newly allocated memory. It must be a valid, NULL-terminated C-string. Return a pointer to the result string. The function can assume that parameter str points to a valid, NULL-terminated C-string. You can use cstring utility functions like strcpy(), strlen(), etc. if you wish, but you are not required to. Please demonstrate calling this function. Example: dup("Giants")should return a pointer to a newly-allocated, null-terminated C-string: "GiantsGiants" char* dup(char *str)arrow_forwardWrite a program that removes all spaces from the given input. Ex: If the input is: Hello my name is John. the output is: HellomynameisJohn. Your program must define and call the following function. The function should return a string representing the input string without spaces.string RemoveSpaces(string userString) #include <iostream>#include <algorithm>using namespace std; string removeSpaces(string str) { str.erase(remove(str.begin(), str.end(), ' '), str.end()); return str; } /* Define your function here */ int main() {string str; str = removeSpaces(str); cout << str << endl; /* Type your code here. Your code must call the function. */ return 0;} Please help me with this problem using c++.arrow_forward
- Implement the following C function: repeatChars take in a null-terminated string as an argument and returns a newly- allocated null-terminated string that repeats every character in the input string. For example, repeatChars(''abcd'' )=''aabbccdd'' . You may use the strlen function to determine the length of the string your implementation does not need to check whether malloc returns NULL C Your implementation should not modify the input stringarrow_forwardplease Use PYTHONarrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





