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
Andrej [43]
1 year ago
14

the function must find the substrings of s that start with a vowel and end with a consonant, then print the alphabetically first

and alphabetically last of these substrings.
Computers and Technology
1 answer:
PolarNik [594]1 year ago
7 0

According to the parameters given in the questions above, the alphabetically lowest and highest substrings that start with a vowel and end with a Consonant is given below.

<h3>What is the determined substrings described above?</h3>

The determined substring is given by the following:

def findSubstrings(s):

   sub_strings_list=[]    #the required substrings list

   vowels=['a','e','i','o','u']    #vowels list

   for i in range(0,len(s)):    

       for j in range(i+1,len(s)+1):

           sub_string=s[i:j]    #slicing the original string into substring

           #checking whether the substring starts with a vowel and ends with a consonant

           if(sub_string[0] in vowels and sub_string[-1] not in vowels):    

               if(sub_string not in sub_strings_list):    #checking if the substring is already in the list

                   sub_strings_list.append(sub_string)    #if all conditions are satisfied adding the substring to the list

   sub_strings_list.sort()    #sorting the list alphabetically

   print(sub_strings_list[0])    #printing the first substring in the list

   print(sub_strings_list[-1])    #printing the last substring in the list

s=input()

findSubstrings(s)

Learn more about substrings:
brainly.com/question/21306076
#SPJ4

Full Question:

Consider a string, s — An alphabetically-ordered sequence Of Of s would be {"a", "ab•, "abc • , "bcu, If the sequence is reduced to only those substrings that start with a vowel and end with a consonant, the result is Cab", •abc"}. The alphabetically first element in this reduced list is •ab", and the alphabetically last element is "abc'. As a reminder:

Vowels: a, e, i, o, and u.

Consonants: b, c, d, f, g, h, i, k, l, m, n, p, q, r, s, t, v, w, x, y, and z.

For a given string, determine the alphabetically lowest and highest substrings that start with a vowel and end with a Consonant.

You might be interested in
Which of the following is a true statement about psychological tests administered by computers? computers make standardization e
Hitman42 [59]
Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions.
the true statement about psychological tests administered by computers is 
<span>most people find computerized tests to be difficult to understand. </span>
7 0
3 years ago
Free brainliest!?! &lt;3​
Sholpan [36]

Meee plzzzzz First!............

4 0
3 years ago
Read 2 more answers
The trademarked name of the accepted standard for configuring wireless networks is _______________
enyata [817]

Answer:

WiFi

Explanation:

WiFi is a standard wireless network configuration developed by IEEE (Institute of Electrical and Electronics Engineers) as a 802.11 standard.

WiFi is embedded in chips in computers and configured for finding wireless routers. WiFi certified points can identify each other, this standardized networks are available almost all online electronic devices.  

Wi-Fi Alliance is the authority to certify devices which satisfy the IEEE 802.11 standards.

3 0
3 years ago
Application software developed by the user or at the user’s request is called ____ software.
Zolol [24]
End-User Software. Because it is not professional

4 0
3 years ago
Write a recursive function that prints out the items of a (possibly empty) singly linked list of integers in reverse order. The
MrRa [10]

Answer:

Follows are the method definition to this question:

void Reverse_Order(struct Node* h)//defining a recursive method Reverse_Order that takes structure in parameter

{

if (h == NULL)//use if block to check head equal to null

return;//use return keyword

Reverse_Order(h->next);//call method recursively

cout<<h->data;//print data

}

Explanation:

In the above code, a recursive method "Reverse_Order" takes structure as the parameter, and inside the method, structure variable h is used that uses the if conditional statement to check the header equal to null.

In the condition is true, it will use the return keyword, and in the next step, it calls the method recursively, and print its value in the reverse order.

8 0
3 years ago
Other questions:
  • What determines the method of controlling motor speed?
    5·1 answer
  • Two students are discussing the flow of electricity. Student A says that voltage is a measure of the amount of electron flow in
    8·1 answer
  • What is the assignment operator?
    15·1 answer
  • Write a program using nested loop to produce the following output:
    6·1 answer
  • You decide to begin your presentation by providing your audience an overview of networking, with an emphasis on security and why
    11·1 answer
  • To implement the various placement algorithms discussed for dynamic partitioning (see Section 7.2 ), a list of the free blocks o
    11·1 answer
  • Given an array a, write an expression that refers to the first element of the array .
    5·1 answer
  • What dog breed is this
    6·1 answer
  • marianne needs to create a version of her slide presentation that does not include all the slides and will be used for a particu
    9·1 answer
  • Plagiarism is considered
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!