Jasten
25.11.2019 •
Engineering
The function below takes two string parameters: sentence is a string containing a series of words separated by whitespace and letter is a string containing a single lower case letter. complete the function to return a string containing one of the words in sentence that contains letter (in either upper case or lower case). your code should return the word with its capitalization in the original sentence. if there are multiple words in sentence that contain letter, you can return any of them. student.py
Solved
Show answers
More tips
- A Animals and plants How ants survive winter: exploring the secrets of their winter life...
- F Food and Cooking Discover How to Properly Prepare Dough for Rasstegai...
- P Philosophy Unidentified Flying Object - What is the Nature of this Phenomenon?...
- F Family and Home Protect Your Home or Apartment from Pesky Ants...
- O Other What is a Disk Emulsifier and How Does it Work?...
- F Family and Home What does a newborn need?...
- F Family and Home Choosing the Right Car Seat for Your Child: Tips and Recommendations...
- F Food and Cooking How to Get Reconfirmation of Registration?...
- C Computers and Internet How to Get Rid of Spam in ICQ?...
- A Art and Culture Who Said The Less We Love a Woman, the More She Likes Us ?...
Answers on questions: Engineering
- B Biology How did indians fight against british colonialism?...
- C Chemistry Awell designed experiment can be replicated by other true or false...
- B Business Which country is not an example of a command economy? Haiti China Vietnam Cuba...
- E English Describe the climate of egypt. why was the nile river important to the egyptians? try to make short answer but can make big answer...
- M Mathematics If angle X has a measure of 40 degrees and angle Y is vertical to angle X, what is the measure of angle Y? Show your work and explain how to solve....
Ответ:
def extract_word_with_given_letter(sentence, letter):
words = sentence.split()
for word in words:
if letter in word.lower():
return word
return ""
# Testing the function here. ignore/remove the code below if not required
print(extract_word_with_given_letter('hello HOW are you?', 'w'))
print(extract_word_with_given_letter('hello how are you?', 'w'))
Ответ:
For me 2:03
Explanation: