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
How bridges are built over water
Black_prince [1.1K]
It’s all depending on what method
4 0
2 years ago
Broker Ray is closely acquainted with the Subdivision Heights neighborhood of his town. Over the year, Ray has made it a practic
spin [16.1K]
No multiple choice?
4 0
3 years ago
Wich command converts a number to a string​
AfilCa [17]

Answer:

okay yes i agree

Explanation:

8 0
3 years ago
Write a program to find the product of 3 numbers
ziro4ka [17]

Answer:

#include<iostream>

using namespace std;

int main()

{

   int a,b,c;

   cout<<"enter the value of a:";

   cin>>a;

   cout<<"enter the value of b:";

   cin>>b;

   cout<<"enter the value of c:";

   cin>>c;

   cout<<"product is:"<<(a*b*c);

   return 0;

}

Explanation:

6 0
3 years ago
Read 2 more answers
What CSS property do you use to determine whether flex items are displayed horizontally or vertically
Hoochie [10]

Answer:

Flex direction

Explanation:

HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.

Generally, all HTML documents are divided into two (2) main parts; body and head.

The head (header) contains information such as version of HTML, title of a page, metadata, link to custom favicons and cascaded style sheet (CSS) etc.

On the other hand, the body of a HTML document contains the contents or informations that a web page displays.

Generally, the part of a HTML document where the cascaded style sheet (CSS) file is linked is the header.

A style sheet can be linked to an HTML document by three (3) main methods and these are;

I. External style.

II. Inline style.

III. Embedded (internal) style.

Flex direction is a CSS property that's used to determine whether flex items are displayed horizontally or vertically.

5 0
3 years ago
Other questions:
  • Please explain external hashing, B-trees, and traversals. 3-5 sentences per
    8·1 answer
  • What are the first and the last physical memory addressesaccessible using
    10·1 answer
  • 18. Using the same formatting elements and designs across slides in a presentation is important to develop?
    5·1 answer
  • _____ separation strategies (e.g., attacking and sabotaging others) are used by those for whom co-cultural segregation is an imp
    5·1 answer
  • Is this a Bad Cpu processor ? I need some.help ASAP I turn on my.pc and it has no display but everything is on fans and the you
    13·1 answer
  • Which part of a touchscreen responds to pressure applied to its surface?
    6·1 answer
  • . Which of the following is NOT a valid declaration for a character string?
    6·1 answer
  • Blair is the director of information systems at a marketing firm. She creates a set of guidelines that dictate everything an emp
    12·1 answer
  • Please help me please it's urgent​
    6·1 answer
  • A Chain of dry-cleaning outlets wants to improve its operations by using data from devices at individual locations to make real-
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!