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
Can someone please help me
inn [45]

A pallet jack is a manually operated forklift

3 0
4 years ago
Most engines will contain how many cylinders in order to maintain a proper balance of weight and forces?
Alika [10]
A. An Even Number is the answer!
4 0
4 years ago
Read 2 more answers
explain the following joke: “There are 10 types of people in the world: those who understand binary and those who don’t.”
sasho [114]

It means that there are people  who understand binary and those that do not understand it. That is, binary is said to be the way that computers are known to express numbers.

<h3>What is the joke about?</h3>

This is known to be a popular  joke that is often  used by people who are known to be great savvy in the field of mathematics.

The joke is known to be one that makes the point that a person is implying that the phrase is about those who only understands the decimal system, and thus relies on numbers in groups of 10.

The binary system is one that relies on numbers that are known to be  in groups of 2.

Therefore, If the speaker of the above phrase is one who is able to understand binary, that person  would  be able to say that that the phrase  is correctly written as  "there are 2 types of people that understand binary".

Learn more about binary from

brainly.com/question/21475482

#SPJ1

7 0
2 years ago
In 150 of your own words, please consider how you might use some of the Outlook skills you reviewed and practiced. Evaluate how
ludmilkaskok [199]

Answer:

If i was to tell you, it wouldn't be in your own words.  However, you can talk about how they have easy access to good materials for writing and organization.  

5 0
3 years ago
What is a milestone? Provide a few examples of milestones.
sineoko [7]

Answer:

A milestone is a significant progress point within your project. Milestones' main purpose is to set goals you have to achieve in order to succeed and complete your project

Explanation:

-Example 1-

You have to write a report for your project. This report contains introduction, problem background, results, and recommendations. The milestones for writing your report could be:

Milestone 1: introduction section is completed

Milestone 2: problem background section is completed

Milestone 3: results section is completed

Milestone 4: recommendations section is completed

-Example 2-

You have to design a webpage that allows the user to login, enters his/her name, and logout. The milestones in this case could be:

Milestone 1: login functionality is completed

Milestone 2: text field for typing the name is placed

Milestone 3: submit name button functionality is completed

Milestone 4: logout button functionality is completed

Milestone 5: all components of the webpage are fully integrated

You might think the goals in these examples can be set differently, and that is true. The definition of the milestones is in general subjective and it depends on how you design the steps you want to follow to complete your project. You might also want to add these milestones to a timeline so you have an estimated schedule of the development of your project.

4 0
3 years ago
Other questions:
  • Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate
    10·2 answers
  • 4. When emergency changes have to be made to systems, the system software may have to be modified before changes to the requirem
    13·1 answer
  • Clep allows students to do all of thw following except which?
    9·2 answers
  • Web 2.0 has led to a shift just from consuming content towards what
    6·1 answer
  • The power we use at home has a frequency of 60 HZ. What is the time period of such a power?
    10·1 answer
  • What is nominal data?
    5·1 answer
  • It is advised to always have discretion with leaders. Explain in general terms what information security policies can and cannot
    12·1 answer
  • The distance between Jupiter and the Sun is 5.2 AU. What is the distance in millions of kilometers? (One AU is about 150 million
    8·2 answers
  • Which of the following would allow for the QUICKEST restoration of a server into a warm recovery site in a case in which server
    10·1 answer
  • The table in columns A-C contains a list of paint color choices for a bathroom and a laundry room. What is a possible sequence o
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!