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 15:30
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
How can a user delete a drawing object
Answers: 1
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
Chemistry, 20.10.2019 05:30
question
Spanish, 20.10.2019 05:30
Questions on the website: 13722367