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
Phoebe has to give a presentation about recycling. Where should she look while presenting?
Naddika [18.5K]
Well, I think that maybe the answer is B or C. She shouldn't only look at her presentation while she is presenting it, that doesn't look professional, and you want to look at the people you are talking to.
6 0
3 years ago
Read 2 more answers
1.Public policy begins with . 2.Then, government officials . 3.Finally, a government agency .
dexar [7]

Answer:

what was the wuestion

Explanation:

cause we dont know how to help you

4 0
3 years ago
In the original UNIX operating system, a process executing in kernel mode may not be preempted. Explain why this makes (unmodifi
Elena L [17]

Answer:

the preemption is -> The ability of the operating

system to preempt or stop a currently

scheduled task in favour of a higher priority

task. The scheduling may be one of, but not

limited to, process or 1/0 scheduling etc.

Under Linux, user-space programs have always

been preemptible: the kernel interrupts user

space programs to switch to other threads,

using the regular clock tick. So, the kernel

doesn't wait for user-space programs to

explicitly release the processor (which is the

case in cooperative multitasking). This means

that an infinite loop in an user-space program

cannot block the system.

However, until 2.6 kernels, the kernel itself was

not preemtible: as soon as one thread has

entered the kernel, it could not be preempted to

execute an other thread. However, this absence

of preemption in the kernel caused several

oroblems with regard to latency and scalability.

So, kernel preemption has been introduced in

2.6 kernels, and one can enable or disable it

using the cONFIG_PREEMPT option. If

CONFIG PREEMPT is enabled, then kernel code

can be preempted everywhere, except when the

code has disabled local interrupts. An infinite

loop in the code can no longer block the entire

system. If CONFIG PREEMPT is disabled, then

the 2.4 behaviour is restored.

So it suitable for real time application. Only

difference is we don't see many coders using it

5 0
3 years ago
C was created to work with UNIX systems in1972, and would be the foundation for several other programming languages, including j
san4es73 [151]

Answer:

True

Explanation:

C language is developed with the help of UNIX in 1972. It was developed by Denis Ritchie at Bell labs. many languages are developed with the help of C Platform. Such as C++, C sharp and Java.

7 0
3 years ago
PLEASE HELP!
ss7ja [257]

Explanation:

Case-sensitivity is inherently faster to parse (albeit only slightly) since it can compare character sequences directly without having to figure out which characters are equivalent to each other. It allows the implementer of a class/library to control how casing is used in the code.

3 0
2 years ago
Other questions:
  • Define a function begins_with_line that consumes a string and returns a boolean indicating whether the string begins with a dash
    15·1 answer
  • The actual database of active directory shared resources is stored on one or more computers designated as:
    10·1 answer
  • Consider the unsigned decimal number 35. What is the value in hexadecimal?<br><br> 3510 = _______ 16
    9·1 answer
  • Regulatory and informational markers are easily identified through which features
    12·1 answer
  • A strategic business unit​ (SBU) of a major corporation has high market share in its​ industry, but the growth rate of the indus
    8·2 answers
  • The Speed of Sound (Java Project. Please make it easy to understand. I'm a beginner at this. I believe we are supposed to use a
    5·1 answer
  • Test if a number grade is an A (greater than or equal to 90). If so, print "Great!". Sample Run Enter a Number: 98 Sample Output
    7·1 answer
  • How do I use this without the spring?
    6·1 answer
  • There are six different sequences for the three approval tasks: check inventory; check credit; check special terms.
    5·1 answer
  • Keith would like to compare data he has collected from research. The data includes the electrical output
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!