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
erastova [34]
3 years ago
6

The function below takes two string parameters: sentence is a string containing a series of words separated by whitespace and le

tter 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
Engineering
1 answer:
Eddi Din [679]3 years ago
4 0

Answer:

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'))

You might be interested in
To put out a class D metal fire, you must _______ the fire.
gladu [14]

To put out a class D metal fire, you must smother the fire and eliminate the oxygen element in the fire.

<h3>What is a Class D fire?</h3>

A class D fire is a type of fire that cannot be extinguished by water. This is because adding water to it reacts with other elements in the fire intensifying the fire even more.

Smothering in this context involves adding a solution like carbon dioxide (CO2) into the fire, this results in a reduction of oxygen in the atmosphere surrounding the class D fire.

By so doing, smothering the fire eliminates the oxygen element in the fire, thereby extinguishing the fire.

You can learn more about extinguishing fires here https://brainly.in/question/760550

#SPJ1

7 0
2 years ago
Assume (for simplicity in this exercise) that only one tuple fits in a block and memory holds at most three blocks. Show the run
den301095 [7]

Answer:

See explaination

Explanation:

Let's define tuple as an immutable list of Python objects which means it can not be changed in any way once it has been created.

Take a look at the attached file for a further detailed and step by step solution of the given problem.

6 0
3 years ago
Write a program that removes all spaces from the given input. You may assume that the input string will not exceed 50 characters
GrogVix [38]

Answer:

Program that removes all spaces from the given input

Explanation:

// An efficient Java program to remove all spaces  

// from a string  

class GFG  

{  

 

// Function to remove all spaces  

// from a given string  

static int removeSpaces(char []str)  

{  

   // To keep track of non-space character count  

   int count = 0;  

 

   // Traverse the given string.  

   // If current character  

   // is not space, then place  

   // it at index 'count++'  

   for (int i = 0; i<str.length; i++)  

       if (str[i] != ' ')  

           str[count++] = str[i]; // here count is  

                                   // incremented  

         

   return count;  

}  

 

// Driver code  

public static void main(String[] args)  

{  

   char str[] = "g eeks for ge eeks ".toCharArray();  

   int i = removeSpaces(str);  

   System.out.println(String.valueOf(str).subSequence(0, i));  

}  

}  

5 0
3 years ago
Read 2 more answers
In a food processing facility, a spherical container of inner radius r1 = 40 cm, outer radius r2 = 41 cm, and thermal conductivi
Rashid [163]

Answer:

attached below

Explanation:

5 0
3 years ago
A piece of aluminum wire is 500 ft long and has a diameter of 0.03 inches. What is the resistance of the piece of wire?​
dexar [7]

Answer:

8.85 Ω

Explanation:

Resistance of a wire is:

R = ρL/A

where ρ is resistivity of the material,

L is the length of the wire,

and A is the cross sectional area.

For a round wire, A = πr² = ¼πd².

For aluminum, ρ is 2.65×10⁻⁸ Ωm, or 8.69×10⁻⁸ Ωft.

Given L = 500 ft and d = 0.03 in = 0.0025 ft:

R = (8.69×10⁻⁸ Ωft) (500 ft) / (¼π (0.0025 ft)²)

R = 8.85 Ω

5 0
3 years ago
Other questions:
  • Data becomes information when it is__________ in some way and made___________
    5·1 answer
  • A gear and shaft with nominal diameter of 34 mm are to be assembled with a medium drive fit (H7/s6). The gear has a hub, with an
    9·1 answer
  • Que rol tiene el ecosistema el patos
    15·1 answer
  • Calculate the potential energy in kJ of a human body (70 kg) possesses on top of the Empire State Building (1,250 ft tall).
    7·1 answer
  • Define coordination number. How does this differ from atomic packing factor?
    7·1 answer
  • read a file called filled in with a few sentences or a paragraph. Then write a function called typoglycemia, which scrambles the
    13·1 answer
  • Please please help please with this this is the link for the story PLEASE PLEASE HELP PLEASE PLEASE help please
    7·1 answer
  • What is the line called that has the red arrow pointing to it in the attached picture?
    6·1 answer
  • Give three examples of how engineering has made human life better in your opinion.
    13·1 answer
  • Additional scals apply to the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!