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]
2 years 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]2 years 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
To deny a host from sending HTTP traffic destined to a specific server you will need to apply a __________ Access Control List.
DedPeter [7]

I would a Standard Access control List

There are two common access lists: The standard and extended access list.  With the standard access list, it creates filters only on source addresses and is commonly used for server-based filtering. They are not as powerful as extended access lists. Standard Access lists are typically used for restricting access to a router through HTTP and HTTPS.  


6 0
3 years ago
Read 2 more answers
Can Sombody please help me with this question, I'm struggling!
hjlf

Answer:

umm let me check if my answer is right

Explanation:

3 0
3 years ago
When you tried to login to server your trail may faild this failure event is recorded in<br>​
julia-pushkina [17]
Real time not online time...
8 0
3 years ago
how to plot a trianing field (running track around football field) in matlab. Parameters are two lines and two semicircles. Each
Morgarella [4.7K]

Is this a question or answer? Either re-post correctly or ignore this.

4 0
3 years ago
Your disaster recovery plan calls for backup media to be stored at a different location. The location is a safe deposit box at t
butalik [34]

Answer:

Perform a full backup once per week and a differential backup the other days of the week.

4 0
3 years ago
Other questions:
  • With a(n) ____ structure, you perform an action or task, and then you perform the next action in order.
    6·1 answer
  • Plz help me of this answer<br><br><br>language:python​
    7·2 answers
  • The mac group does not replace the primary functions of eocs or other dispatch organizations. True or False
    8·1 answer
  • How many bits would be in the memory of a computer with 4kb memory?
    8·1 answer
  • The font color grid is located in the color group on the design tab. (points : 2) true false
    9·1 answer
  • What invention in the past do you think had a significant impact on our culture/ lifestyle? What do you think will be invented/
    11·1 answer
  • 2.13 LAB: Branches: Leap Year
    11·1 answer
  • State Whether the given statement are TRUE OR FALSE. 13X1=13
    10·1 answer
  • Any one know??please let me know
    15·2 answers
  • Cmo se puede añadir amigo ??'
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!