Python Forum
AttributeError: module 'string' has no attribute 'uppercase'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AttributeError: module 'string' has no attribute 'uppercase'
#2
It's .upper not .uppercase
https://docs.python.org/3/library/stdtyp...#str.upper Wrote:str.upper()
Return a copy of the string in which each character has been mapped through the given translation table. The table must be an object that implements indexing via __getitem__(), typically a mapping or sequence. When indexed by a Unicode ordinal (an integer), the table object can do any of the following: return a Unicode ordinal or a string, to map the character to one or more other characters; return None, to delete the character from the return string; or raise a LookupError exception, to map the character to itself.

You can use str.maketrans() to create a translation map from character-to-character mappings in different formats.

See also the codecs module for a more flexible approach to custom character mappings.

I just noticed it's the string module not an actual string, in that case you probably wanted
https://docs.python.org/3/library/string..._uppercase Wrote:string.ascii_uppercase
The uppercase letters 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. This value is not locale-dependent and will not change.
Anldra12 likes this post
Reply


Messages In This Thread
RE: AttributeError: module 'string' has no attribute 'uppercase' - by Yoriz - Apr-22-2021, 05:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  trouble reading string/module from excel as a list popular_dog 0 512 Oct-04-2023, 01:07 PM
Last Post: popular_dog
  getpass.getpass() results in AttributeError: module 'os' has no attribute 'O_NOCTTY' EarthAndMoon 4 1,007 Oct-03-2023, 02:00 PM
Last Post: deanhystad
  AttributeError: '_tkinter.tkapp' object has no attribute 'username' Konstantin23 4 2,286 Aug-04-2023, 12:41 PM
Last Post: Konstantin23
  Parallel processing - AttributeError: Can't get attribute 'sktimekmeans' Mohana1983 1 901 Jun-22-2023, 02:33 AM
Last Post: woooee
  Python: AttributeError: 'PageObject' object has no attribute 'extract_images' Melcu54 2 4,570 Jun-18-2023, 07:47 PM
Last Post: Melcu54
  cx_oracle Error - AttributeError: 'function' object has no attribute 'cursor' birajdarmm 1 2,771 Apr-15-2023, 05:17 PM
Last Post: deanhystad
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 12,960 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  Pandas AttributeError: 'DataFrame' object has no attribute 'concat' Sameer33 5 6,404 Feb-17-2023, 06:01 PM
Last Post: Sameer33
  AttributeError: 'numpy.ndarray' object has no attribute 'load' hobbyist 8 7,522 Jul-06-2022, 10:55 AM
Last Post: deanhystad
  AttributeError: 'numpy.int32' object has no attribute 'split' rf_kartal 6 4,781 Jun-24-2022, 08:37 AM
Last Post: Anushka00

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020