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
Scorpion4ik [409]
3 years ago
5

Write a function isRed() that accepts a string parameter and looks for the presence of the word ‘red’ in the string. If it is fo

und, return boolean True otherwise False. Finally output the result of calling the function with the value in text.
Computers and Technology
2 answers:
Ilia_Sergeevich [38]3 years ago
7 0

Answer:

Using the Python Programming Language:

def isRed(myString):

   if "red" in myString:

       return True

   else:

       return False

Explanation:

The function definition is given above. To output the result of calling this function, we declare a string variable and call the function inside a print statement. See the two lines of code below:

myString= "My house is coloured red"

print (isRed(myString))

Notice that we defined the function called isRed to receive a string as a parameter, Then using the in keyword with an if statement, we check for the presence of the word 'red' in the string that is passed as argument to the function, the function will then return True if the word 'red' is present or False if it is not.

Kitty [74]3 years ago
3 0

Answer:

Following is the code for the function isRed() that works according to given scenario:

import sys

text = sys.argv[1]

def isRed(text):

if(text.find('red')!=-1):

return True

else:

return False

Explanation:

  1. First of all the input is taken from the user through command line using statement text = sys.argv[1]
  2. The function named isRed is defined by putting text variable as parameter to it.
  3. The function uses if else statement and says if the input text contains red then return True as the output to the function.
  4. Otherwise if 'red' is not found then the output of the function will be False.

i hope it will help you!

You might be interested in
What component of a change management program includes final testing that the software functions properly
ValentinkaMS [17]

A component of a change management program which includes final testing that the software functions properly is: C) Release management.

<h3>What is SDLC?</h3>

SDLC is an acronym for software development life cycle and it can be defined as a strategic methodology that defines the key steps, phases, or stages for the design, development and implementation of high quality software programs (applications).

In Computer science, there are seven (7) phases involved in the development of a software program and these include the following;

  • Planning
  • Analysis
  • Design
  • Development (coding)
  • Testing
  • Deployment
  • Maintenance

At the final testing stage, a component of a change management program which ensure that the software functions properly is known as release management.

Read more on software here: brainly.com/question/26324021

#SPJ1

Complete Question:

What component of a change management program includes final testing that the software functions properly?

A) Request management

B) Change management

C) Release management

D) Iteration management

5 0
2 years ago
Question 6 (1 point)
Marysya12 [62]
<h2>answers</h2>

Extranet

wifi create extranet so that our mobile network runs smoothly. it can create lan,wan also

7 0
3 years ago
Tạo biến
rewona [7]

Answer:

WHERE ARE YOU FROM

Explanation:

TRANSLATE IT TO ENGLISH

5 0
3 years ago
Huan wants to enter the science fair at his school. He has a list of ideas for his project. Which questions could be answered th
never [62]

<u>Answer:</u>

<em>Science fair always has experiments which prove science concepts.</em> Students will bring apparatus or an lab items and show experiments as a magic. There are only certain things which a Science can prove and show to other.

<em>From the given question, the following can be proved: </em>

  • <em>Does pressure have an effect on the volume of a gas? </em>
  • <em>Which brand of soap is the best for cleaning grease off dishes? </em>
  • <em>Which laboratory experiment is the most fun to perform?</em>

<em> The below cannot be proved but can be explained </em>

  • <em>Is the information on the periodic table difficult to understand? </em>
  • <em>Which physicist was the smartest?</em>
4 0
4 years ago
A(n) _____ exists when there are functional dependencies such that XY is functionally dependent on WZ, X is functionally depende
Nat2105 [25]

A partial dependency exists.

We have two types of dependency. The partial dependency and the transitive dependency.

The answer here is partial dependency. It occurs when the attribute only depends on some parts of the element. In such attribute, the primary key is the determinant.

It can be shown as;

XY→WZ , X→W and XY is the primary key or the only candidate key

Read more at brainly.com/question/9588869?referrer=searchResults

3 0
3 years ago
Read 2 more answers
Other questions:
  • Monica needs a printer to use at home. She wants fine-quality prints at an affordable cost. Which printer will help her achieve
    9·1 answer
  • Can anybody come up with a catchy title for this?
    11·1 answer
  • What best describes deflation?
    9·2 answers
  • Who's YouTube creator?
    10·2 answers
  • Help me I'm so confused by this question
    7·1 answer
  • What is a Stereo In (&amp; Out) in audio?
    7·1 answer
  • How can i get google assistant on my lava iris 820 smartphone easily???? ​
    10·1 answer
  • question i need a real answer cuase i have a virus cuase off my borther and these are the notifacations i get and now these site
    11·1 answer
  • Definition of digital
    9·2 answers
  • Which of the following terms refers to the cells that contain values and labels to be graphed in the chart?.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!