7.12 LAB: Contains the character
2 answers:
Answer:there is Java program and C++ program
Explanation:
Answer:
The solution code is written in Python 3
input_char = input("Enter a character: ")
sentence = input("Enter a sentence: ")
word_list = sentence.split(" ")
for word in word_list:
for c in word:
if(c == input_char):
print(word)
break Explanation:
Firstly, use the input function to get a input character and sentence from user (Line 1 - 2)
Next, use the split method to divide the sentence into a list of individual words using single space as the delimiter (Line 4).
Create an outer for loop to traverse each word in the word_list and create another inner loop to traverse each character in the word and check if there is any character match with the input character. If so print the word and terminate the inner loop and proceed to the next round of the outer loop.
After finishing the loop, all the relevant words will be printed.
You might be interested in
What is the best definition of a contextual tab-<u>(c) A tab that appears in context with what you are working on </u> A theme can be applied to-<u>(d) All of the answers are correct </u> Explanation:
What is the best definition of a contextual tab-<u>(c) A tab that appears in context with what you are working on </u> A theme can be applied to-<u>(d) All of the answers are correct </u> What is the difference between Reading view and Slide Show view-<u>(c) Slide Show view contains annotation tools while Reading view does not</u> Which of the following is not a view available from the Presentation Views section of the View tab-<u>(a) Slide Show </u> Where can you find the command to access slide, note, or handout masters-<u>(d) View tab</u> To rotate a text box, which handle would you use-<u>(d) You must use the commands on the Home tab </u> To change a black and white, boring presentation into something a bit more pleasing to the eye, what option would be best-<u>(b) Templates </u> The area on the top of your PowerPoint screen, as seen in the image, is commonly referred to as the what-<u>(a) Menu Options </u> What does it mean when a command button is grayed out-<u>(c) The command is disabled and requires an action first. </u> The area on a slide that holds text that will appear in the presentation outline is a-<u>(a) text box </u> To easily find a presentation that you were working on earlier today, you could-(<u>c) all of the above </u>
No I don’t think so personally
This is for Python
number = int(input('Number: '))
number = number * 12
print(number)
Answer:
3
Explanation:
= 1 + (int) (4*(63 - 51)/(71-51)))
= 1 + (int) (4*12/20)
= 1 + (int) (48/20)
= 1 + (int)2.4
= 1 + 2
= 3
A process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.