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
The author of ""Cyber-psychopathy: What Goes On in a Hacker’s Head"" states that a crucial component of computer hacking lies in
slega [8]

Answer: The statement implies that the hackers psychologically manipulate the human to access the information they need.

Explanation: The author states that the hacker does not only exploits technology to get system access or to gather information. But there is another pivotal part of hacking. He refers to this part as "social engineering".

Social engineering from information security perspective means manipulate human emotions and convincing them to disclose some confidential information. Hacker often hacks or defrauds after gaining confidence and trust of a person.

Phishing is an example. It is a fraudulent technique for getting some secret information. Phisher sends an email pretending to be from some reputable organization to persuade people to divulge private information like passwords and credit card numbers, ATM card pin etc.

5 0
3 years ago
The first row in a table is referred to as the _____ row and the last row is considered the _____ row.
Juliette [100K]

the first row in a table is classed as the header row.

and with the last one I'm not sure because as far as I know there's not considered a last row.

6 0
2 years ago
In c please
Paraphin [41]

Answer:

#include <stdio.h>

#include <ctype.h>

void printHistogram(int counters[]) {

   int largest = 0;

   int row,i;

   for (i = 0; i < 26; i++) {

       if (counters[i] > largest) {

           largest = counters[i];

       }

   }

   for (row = largest; row > 0; row--) {

       for (i = 0; i < 26; i++) {

           if (counters[i] >= row) {

               putchar(254);

           }

           else {

               putchar(32);

           }

           putchar(32);

       }

       putchar('\n');

   }

   for (i = 0; i < 26; i++) {

       putchar('a' + i);

       putchar(32);

   }

}

int main() {

   int counters[26] = { 0 };

   int i;

   char c;

   FILE* f;

   fopen_s(&f, "story.txt", "r");

   while (!feof(f)) {

       c = tolower(fgetc(f));

       if (c >= 'a' && c <= 'z') {

           counters[c-'a']++;

       }

   }

   for (i = 0; i < 26; i++) {

       printf("%c was used %d times.\n", 'a'+i, counters[i]);

   }

   printf("\nHere is a histogram:\n");

   printHistogram(counters);

}

5 0
2 years ago
Vivek wants to save the data about his grocery store in a single table. Which among the following type of databases is used in t
Orlov [11]

Explanation:

A centralized database (sometimes abbreviated CDB) is a database that is located, stored, and maintained in a single location.

4 0
2 years ago
When light hits an opaque object it will be _______________.
nikklg [1K]
None of it passes through. Most of the light is either reflected by the object or absorbed and converted to heat. Materials such as wood, stone, and metals are opaque to visible light.

Good luck
7 0
1 year ago
Other questions:
  • WILL MARK BRAILIEST IF ANSWERED FAST!!!
    8·1 answer
  • You will start by doing a bit of research on viewfinders and LCD displays on digital cameras. After you feel that you have an un
    10·1 answer
  • How would you compare and contrast the impact of the printing press with the impact of the internet?
    15·1 answer
  • Internet is for everyone but it wont be if its users cannot protect their privacy and the confidentiality of transactions conduc
    6·1 answer
  • (1)similarities between backspace key and delete key. (2) different between backspace key and delete key. (3) explain the term e
    10·1 answer
  • A RISC processor has 186 total registers, with 18 global registers. There are 12 register windows, each with 10 locals. How many
    5·1 answer
  • Create a program that simulates a race between several vehicles. Design and implement an inheritance hierarchy that includes Veh
    11·1 answer
  • What is considered appropriate dress for men and women in the workplace? Select all that apply.
    6·2 answers
  • HW2.24. Statement: Area of a Triangle The area of a triangle can be computed by knowing the base and height of the triangle usin
    11·1 answer
  • What are the total number of rows and columns on a worksheet?.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!