Write a program that reads a string and display the longest substring of the given string having just the consonants.
Answers
Answered by
0
The program for the given question is as follows:
line = raw_input (“Please make an entry :”) // input
a = len (line)
max a = 0
max b = ‘ ‘
b = ‘ ‘
len b = 0
for x in range (a) : // loop
if string [x] in 'aeiou'or string [x] in 'AEIOU' : // conditional statement
if len b > max a : // conditional statement
max b = b
max a – len b
b = len b
else :
b + = a [x]
len b = len (b)
x + = 1
print (“Maximum length is :”, maxb) // output
print (“with”, maxlength, “characters”) // output
Similar questions
Economy,
5 months ago
Math,
5 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago
Math,
1 year ago