Answer:
Hi there! The question can easily be implemented by iterating through the array list an using the "startswith()" function of the String class. Please find explanation below.
Explanation:
We can write the code as below into a file called starts_with.py and run it from the command line. Sample input is also provided with results.
starts_with.py
import sys;
def starts_with(prefix, wordlist):
for e in wordlist:
if e.lower().startswith(prefix.lower()):
starts_with_array.append(e);
starts_with_array = [];
prefix = input("Enter prefix: ");
wordlist = input("Enter word list: ");
wordlist = wordlist.split(',');
starts_with(prefix, wordlist);
print(starts_with_array);
Usage with Result
> starts_with.py
> Enter prefix: Fun
> Enter word list: Funtastic,Fun,Test,No
> ['Funtastic', 'Fun']
1. B
2. B
3. C
i could not get the rest and for the matching, there were not any choices
The correct answer is letter D. they're convenient. The chief reason that family and friends are frequent targets of aggression is that (D) they're convenient. Aggression is he feeling of harmful in terms of social interaction with the intention or goal of damaging other individual. Family and friends have already made a big interaction between each other.