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
Modify the guessing-game program so that the user thinks of a number that the computer must guess.
olga_2 [115]

Answer:

import random

import math

smaller = int(input("Enter the smaller number: "))

larger = int(input("Enter the larger number: "))

count = 0

print()

while True:

   count += 1

   myNumber = (smaller + larger)

   print('%d %d' % (smaller, larger))

   print('Your number is %d' % myNumber)

   choice = input('Enter =, <, or >: ')

   if choice == '=':

       print("Hooray, I've got it in %d tries" % count)

       break

   elif smaller == larger:

       print("I'm out of guesses, and you cheated")

       break

   elif choice == '<':

       larger = myNumber - 1

   else:

       smaller = myNumber + 1

Explanation:

  • Inside an infinite while loop, add the smaller and larger number and assign that value to myNumber variable.
  • Check the choice and then print the relevant display message.
5 0
3 years ago
When heating a substance a phrase change will start to occur when the kinetic energy of the particles is blink the attractive fo
disa [49]

Answer:

great enough to overcome.

Explanation:

Kinetic energy can be defined as an energy possessed by an object or body due to its motion.

Mathematically, kinetic energy is given by the formula;

Where, K.E represents kinetic energy measured in Joules.

M represents mass measured in kilograms.

V represents velocity measured in metres per seconds square.

A conductor can be defined as any material or object that allows the free flow of current or electrons (charge) in one or more directions in an electrical circuit. Some examples of a conductor are metals, copper, aluminum, graphite, etc.

When heating a substance, a phase change will start to occur when the kinetic energy of the particles is great enough to overcome the attractive forces between the particles.

Basically, the phase change includes solid, liquid and gas.

8 0
3 years ago
According to the text, the judicious use of elements such as bullets, numbers, boldface, italics, and capitalization in document
kaheart [24]

Answer:

Facilitating interactivity.

Providing visual variety.

Emphasizing key information.

Explanation:

The judicious use of these elements helps the author in various different ways. These characters facilitate the interaction of the reader with the text by making it easier for him to understand the best way to proceed with the reading. Moreover, they provide visual variety, which makes information easier to process for the reader. Finally, these characters also emphasize key information, helping with reading comprehension.

6 0
3 years ago
A company sells 12-month subscriptions to popular magazines. During the month of may, the company sells $10,000 in magazines, wh
Korvikt [17]

Good is for aware consumers who value quality of life, fashion, and the environment. The areas of home, fashion, gardening, crafts, travel, health, and beauty are all covered in each issue of Good.

<h3>What journal entry to record the sales not yet earned?</h3>

When a business sells any merchandise to a third party on credit, an entry called a sales credit journal entry is made in the company's sales journal.

There is usually a selection of delectable dishes as well as professional advice on relationships, wellness, and nutrition.

Therefore,  In this instance, the sales account is credited in proportion to the debit to the debtor's account or account receivable account.

Learn more about journal entry here:

brainly.com/question/20421012

#SPJ1

4 0
1 year ago
HOW DO I CONNECT TO MY mysql server on my computer locally using php and also how to run it on the browser
zhuklara [117]

Answer:

<?php

$mysqli = new mysqli("127.0.0.1:3307", "myUser", "myPass", "databasename");

$query = "SELECT * FROM users ORDER BY name";

if($result = $mysqli->query($query))

{

   echo '<ul>';

while ($obj = $result->fetch_object())

   {

       echo '<li>'.$obj->name.'</li>';

   }

   $result->free();

   echo '</ul>';

}

else

{

   die("nothing found");

}

$mysqli->Close();

?>

Explanation:

This should get you started.

7 0
2 years ago
Other questions:
  • Which early modernism trend in art focused on prehistoric or exotic cultures? primitivism expressionism impressionism total seri
    7·1 answer
  • What does the Autosum feature on excel do?
    15·1 answer
  • The field on which records are sorted is called the composite primary key.A. TrueB. False
    12·1 answer
  • The company that you work for has recently had a security breech. During the recover and assessment, it was discovered that the
    5·1 answer
  • Which of the following statements isNOT true about abstract data types (ADTs)?A list is anexample of an ADT.ADTs hide theimpleme
    7·1 answer
  • A lamp outside a front door comes on automatically when it is dark, and when someone stands on the doormat outside the front doo
    7·1 answer
  • When pasting a circle drawn by the presentation software drawing tool into a spreadsheet, that circle will go into the selected
    10·2 answers
  • Is anyone else excited for sephiroth (I think I spelt it wrong) in smash. And if you arn't are you excited for christmas
    12·1 answer
  • 1. ¿Qué es un cursograma?
    9·2 answers
  • When looking at security standard and compliance, which three (3) are characteristics of best practices, baselines and framework
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!