1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
astra-53 [7]
3 years ago
7

Create a function called "strip_r_o" that takes in a STRING and strips all the Rs and Os from the string. Also use a FOR loop in

you program to check each letter of the STRING
Python

Computers and Technology
1 answer:
Arada [10]3 years ago
7 0

Answer:

The program is as follows (Take note of the comments and see attachment)

#Start of Program

def strip_r_o(word): #Declare Function strip_r_o

     resultt = "" #initialize resultt to empty string

     for i in range(len(word)): #Iterate from first character of input string to the last

           if (not word[i] == "R") and (not word[i] == "O"): #Check if current character is not R and O

                 resultt = resultt + word[i] #if condition is true, add character to resultt

     print(resultt) #Print string after character has been removed

#End of Function

Word = input("Enter a string: ") #Prompt user for input

strip_r_o(Word) #Call strip_r_o function

#End of Program

Explanation:

The program starts and end with a comment

Line 2 of the program declares function strip_r_o

Line 3 initializes a string variable resultt to an empty string

Line 4 iterates from first character of input string to the last  

Line 5 checks each character for O or R

If true, line 6 is executed by removing O or R from the input string and saving what's left in variable resultt

Line 7 prints the end result after O and R have been removed from the input string

Line 8 is a comment

Line 9  prompts user for an input string

Line 10 calls the strip_r_o function

You might be interested in
What is Game Theory?
AleksandrR [38]

Answer:

the branch of mathematics concerned with the analysis of strategies for dealing with competitive situations where the outcome of a participant's choice of action depends critically on the actions of other participants

Explanation:

In simple terms Game theory is the study of how and why people make decisions.

8 0
3 years ago
1. Why isn't solar energy usually the only power source for a region?
ale4655 [162]
1. Every region doesnt get the same amount of sunlight as the rest due to whether or location an example would be that a region with alot of rain could have clouds that wouldnt let the solar panels to absorb as much sunlight as a more dry and sunny place 
2 wind farms can be used to store energy for a power outage and a way to lower the cost of electricity to a farmer 
3 using hydro energy requires people to build a dam that pours the water over a mill that rotates and stores energy from it 
4 a type of waste created by nuclear power plants would be daily uses that have radiation such as plastic containers ,gloves , disposable overalls, boots or just plain radioactive waste.
5 would be the total mass of organisms in a given area or volume 
6 is a process to further limit carbon dioxide emissions from burning coal
7 is basically the means to tap into energy savings that over time become an asset 
8 turning down the water heater thermostat and turning off lights when not in use can save energy 
9 smart grids use timing grid to determine how long you use electricity for and for how much you used
6 0
3 years ago
Read 2 more answers
When one makes a social media post, what happens on other devices with the same app?
victus00 [196]

Answer:

An alert appears on the other devices

Explanation:

On social media platforms, whenever some one make a post, all the person who are using that social media app and present in the friend circle of that particular person receive an alert containing the information of the post.

The alert that received by different users on a social media platform is known as Notification. This notification is a type of text, in which the activity performed by post creator is mentioned, this text is received with the tone called notification tone.

The purpose of the alert is to informs the friends who are using that social media platform that a post has been published by someone.  

8 0
3 years ago
What are some examples of objects you can browse by in the Select Browse Object options? Check all that apply. folders pages gra
Brums [2.3K]

pages

graphics

comments

sections

tables

4 0
3 years ago
__________ are the first line of defense against unsafe drivers.
vova2212 [387]
Peace officers are the first line of defense against unsafe drivers. These officers are appointed for a specific purpose of upholding law and order, so they would be the ones who are there to help you in case of an accident caused by unsafe drivers. A peace officers is just another term for a law enforcement officer, or just the police.
5 0
3 years ago
Other questions:
  • In a word processing program, the ribbon or menus contain the
    12·1 answer
  • Write a C or C program A6p2.c(pp) that accepts one command line argument which is an integer n between 2 and 4 inclusive. Genera
    9·1 answer
  • 12.
    10·1 answer
  • Computer Architecture
    7·1 answer
  • Which type of market are you in if your firm, along with three other firms, controls 95% of the total music industry?
    13·1 answer
  • The crash rate per mile is ..
    12·2 answers
  • Which entity has the principal responsibility to control the execution of processes?
    14·1 answer
  • You would like to emphasize certain key terms on a slide with a bold format. Which slide element should you modify to provide th
    15·2 answers
  • (I WILL MARK BRAINLIST) What are the most important things a student should consider when creating a presentation on something t
    7·2 answers
  • What web browser feature would be particularly useful when using public computers?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!