subject
Engineering, 16.06.2020 22:57 tonio638

Tip: String. find(searchWord)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'))RUN FIND TESTWrite 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. CHECK IT!# Get our input from the command lineimport systext= sys. argv[1]# Write your code here

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 15:10
Ahouse has the following electrical appliance usage (1) single 40w lamp used for 4 hours per day (2) single 60w fan used for 12 hours per day (3) single 200w refrigerator that runs 24 hours per day with compressor run 12 hours and off 12 hours find the solar power inverter size in watt with correction factor of 1.25.
Answers: 1
question
Engineering, 04.07.2019 08:10
Which of the following is an easy way to remember the modified β€œx” tire rotation? a. nondrive wheels straight, cross the drive wheels b. drive wheels straight, cross the nondrive wheels c. drive wheels crossed, nondrive wheels straight d. drive wheels crossed, nondrive wheels crossed
Answers: 1
question
Engineering, 04.07.2019 12:10
On a average work day more than work place firs are reorted
Answers: 1
question
Engineering, 04.07.2019 18:10
Acompressor receives the shaft work to decrease the pressure of the fluid. a)- true b)- false
Answers: 3
You know the right answer?
Tip: String. find(searchWord)In this challenge, you will be asked to find one string in the text of...
Questions
question
Geography, 10.02.2021 21:10
question
Social Studies, 10.02.2021 21:10
Questions on the website: 13722360