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
What is the way to discover requirments for software projects ?
Sav [38]

Learn about requirement analysis by knowing how to identify business requirements and software requirements with ... Here are the objectives for performing requirement analysis in the early stage of a software project:.

6 0
2 years ago
What are the two basic steps in communication
Andrei [34K]

The sender forms an idea.The sender encodes the idea in a message.

4 0
3 years ago
If someone you don’t know asks where you go to school, what should you do
My name is Ann [436]

Answer:

Don't answer him because you don't know what he is going to do

8 0
3 years ago
Which of the following software programs provides for e-mail communication?. A. Access. B. Word Perfect. C. Outlook. D. Excel
torisob [31]

There are several software programs and internet applications that you use to send electronic mail (e-mail) to other people. However, for programs that are part of the Microsoft Suite, only one provides this ability, which is (C) Outlook.  

Microsoft Access is used to manage databases, while Microsoft Excel is used to analyze numerical and text data. WordPerfect is a word processor software created by Corel.  


5 0
3 years ago
Read 2 more answers
Histogram 9AMAA 12/01/2021.
pshichka [43]
??????? I don’t get this
5 0
3 years ago
Other questions:
  • Once the technology for the collection of solar power is in place what will be two benefits of its use
    9·1 answer
  • Consider two sets S1 and S2 of size 3 and 2 each.
    13·1 answer
  • Unit 3 Computer Programming Study Guide
    6·1 answer
  • Technician A says that the first step in the diagnostic process is to verify the problem (concern). Technician B says that the s
    11·1 answer
  • What are two names for the database that holds digital signatures provided by os manufacturers, such as microsoft and red hat?
    6·1 answer
  • What is a wiki farm?
    9·1 answer
  • Reading (BCK FORM 2C IT 2020-2021)
    12·2 answers
  • Help me and i'll mark brainliest
    9·1 answer
  • LCD, EL and gas-plasma are types of flat-panel screens.<br> True<br> False
    13·1 answer
  • A(n) ________ will clear all user data and setting changes, returning the device's software to the state it was in when it left
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!