Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8676177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:07:45+00:00 2026-06-12T20:07:45+00:00

It (should, to me,) say True if there are only vowels in the string(phrase);

  • 0

It (should, to me,) say True if there are only vowels in the string(phrase); otherwise says False. I don’t understand why it always will return False, since (x >= x) always returns True.
I thank anyone for checking the solution to this query.

(str) -> bool

def valid_letter_sequence(abc):

    valid_letters = abc.count('A') + abc.count('E') + abc.count('I') + abc.count('O') + abc.count('U')
    counted_letters = abc.count('')
    if valid_letters >= counted_letters:
        return True
    else:
        return False
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:07:46+00:00Added an answer on June 12, 2026 at 8:07 pm

    Observe:

    >>> 'abc'.count('')
    4
    

    Passing an empty string to count gives you one more than the length of the string (because it finds the empty string at both ends as well as between every pair of characters). Why don’t you just use len(abc)?

    More generally, there are better ways to do what you’re doing. Like maybe this:

    def valid_letter_sequence(abc):
        return not (set(abc) - set('AEIOU'))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question should say it all. Let's say there's a local file mydefaultvalues.txt, separated from
First off I should say that I don't have any experience in working with
I tried the following: Basically, it should say: If there's no cookie, get lang
This is a simple code that should return true or false after comparing each
I should say I'm looking for something interactive, equivalent to what Nevron offers in
First, i should say that I am relatively new to programming so please be
I want to find how much folders are in folder or I should say
I wan't to divide my CI into multiple applications. I should say that it
Say,should keep the space between letters(a-z,case insensitive) and remove the space between non-letters?
As i am in between 1-2 years experience what should i say to this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.