subject

In this challenge, you will be asked to find one string in the text of another string. Python provides a function to help with this called find() that can be called on any string. To find a string needle in another string haystack, use haystack. find(needle), which will return the position where needle was found, or -1 if it was not found at all. haystack= 'abc def ghi'needle= 'def'needleLocation= haystack. find(needle)print(needneedleLocatio n)print(haystack. find('chicken'))Write a function isRed() that accepts a string parameter and looks for the presence of the word ‘red’ in the string. If it is found, return boolean True otherwise False. Finally output the result of calling the function with the value in text. Requirements:Program Failed for Input: ""Expected Output: FalseGiven Code:# Get our input from the command lineimport systext= sys. argv[1]# Write your code here

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:00
If a client wants to make minor edits, what should he/she use?
Answers: 3
question
Computers and Technology, 23.06.2019 07:30
Which option allows you to view slides on the full computer screen?
Answers: 1
question
Computers and Technology, 23.06.2019 23:00
How do you know if the website is secure if you make a purchase
Answers: 2
question
Computers and Technology, 24.06.2019 00:00
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
You know the right answer?
In this challenge, you will be asked to find one string in the text of another string. Python provid...
Questions
question
Mathematics, 28.11.2020 01:40
question
Spanish, 28.11.2020 01:40
Questions on the website: 13722363