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 5927967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:14:21+00:00 2026-05-22T14:14:21+00:00

So I’m trying to run this, but it errors out and I need help

  • 0

So I’m trying to run this, but it errors out and I need help understanding what’s wrong. I really appreciate any help, I’m taking the MIT opencourseware intro to programming:

words="GreatTimes"
words.lowercase

And I get this error:

AttributeError: 'str' object has no attribute 'lowercase'

The issue is that I’m trying to run example code from “How to think like a computer scientist” and it still gives me the error.

def isLower(ch):
    return string.find(string.lowercase, ch) != -1

So I can’t figure out what the syntax error is. Looking at the Python doc page it says this:

string.lowercase A string containing
all the characters that are considered
lowercase letters. On most systems
this is the string
‘abcdefghijklmnopqrstuvwxyz’. The
specific value is locale-dependent,
and will be updated when
locale.setlocale() is called.

Thoughts?

Edit:
Ah, sorry I should be more clear. So I’m trying to write a piece of code that will tell me whether or not a character in a string is lowercase or not. my code is my implementation of it. while the example code is something i’m using to try to check to see if my syntax is wrong and that is the source of the problem. However, the example code also generates an error. In a nutshell, why doesn’t this code work? It seems like it Should spit out a string of all the lowercase letters like “reatimes” from “GreatTimes” And/or how would you use string.lowercase to make this program?

  • 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-05-22T14:14:22+00:00Added an answer on May 22, 2026 at 2:14 pm

    I’m a bit confused by what you are trying to do. This seems like a rather contrived exercise.

    • If you just want to use an instance method, words.lower() will return a lowercase version of the string words.

    • If you want to implement a lowercase function of your own using string.lowercase (which is just a constant set to a string of all lowercase letters), then you need to make sure you do an import string before calling it (e.g. in your lower function example).

    • If you did an import string, you could also use string.lower('STRING with CAPS') instead.

    Edit: Here’s some code that runs your function, to show you it works:

    import string
    
    def isLower(ch):
        return string.find(string.lowercase, ch) != -1
    
    
    words = "GreatTimes"
    
    lowercase_letters = ""
    for ch in words:
        print ch, '->', isLower(ch)
    
        if isLower(ch):
            lowercase_letters += ch
    
    print "Lowercase letters were:", lowercase_letters
    

    Output:

    G -> False
    r -> True
    e -> True
    a -> True
    t -> True
    T -> False
    i -> True
    m -> True
    e -> True
    s -> True
    Lowercase letters were: reatimes
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

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.