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
How r u<br> ;)<br> happy what day is it
Ivahew [28]

Answer:

o

dw

Explanation:

5 0
2 years ago
Read 2 more answers
PLEASE HELP!!! What are the benefits of online notebooks? Check all that apply.
Kipish [7]

They allow users to store files.

They allow users to share files.

They help users organize assignments.

They allow users to clip information from web pages.

4 0
2 years ago
Read 2 more answers
Which two men developed the steam engine?
Whitepunk [10]

Answer:

Thomas Savery and Edward Somerset.

Explanation:

6 0
3 years ago
The way a particular application views the data from the database that the application uses is a.
masha68 [24]

The way a particular application views the data from the database that the application uses is a sub-schema.

<h3>What is Database?</h3>

A Database may be defined as a process of collecting data and information that is principally assembled for quick search and recoupment by a computer.

The sub-schema is the reasoning elucidation of that section of the database which is applicable and accessible to a specific application. This type of database is common to two or more applications.

Therefore, the sub-schema is the way through which a particular application views the data from the database that the application uses.

To learn more about Database, refer to the link:

brainly.com/question/26096799

#SPJ4

4 0
1 year ago
After the security breach at CardSystems Solutions, a security assessment of the security measures used at the company proved th
Verizon [17]

Answer:

Was not PCI DSS- compliant.

Explanation:

This is a payment Card industry data security standard which is an information security standard that deal with branded credit card.

8 0
3 years ago
Other questions:
  • I need someone whos really good with computers to help me with some things
    12·1 answer
  • This form of analysis is an extension of what-if analysis and is the study of the impact on other variables when one variable is
    8·1 answer
  • A _______ area network is a type of wireless network that works within your immediate surroundings to connect cell phones to hea
    9·2 answers
  • Assume that the string oldSeq has been properly declared and initialized and contains the string segment. Write a code segment t
    6·1 answer
  • If I wished to insert a hyperlink from text in my document to my company website, what type of link would I insert?
    9·1 answer
  • What is human data,
    8·1 answer
  • One of the driving forces in operating system evolution is advancement in the underlying hardware technology.
    8·1 answer
  • Which domain indicates that a website is sponsored by a university or college?
    12·1 answer
  • 2) A simple operating system supports only a single directory but allows it to have arbitrarily many files with arbitrarily long
    7·1 answer
  • What is the location used by users to configure delegate access on their own mailboxes?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!